File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,15 @@ public Object apply(int i) {
186186 public Object get (int i ) {
187187 assertIndexIsValid (i );
188188 final DataType dataType = schema .fields ()[i ].dataType ();
189- // TODO: complete this for the remaining types
189+ // The ordering of these `if` statements is intentional: internally, it looks like this only
190+ // gets invoked in JoinedRow when trying to access UTF8String columns. It's extremely unlikely
191+ // that internal code will call this on non-string-typed columns, but we support that anyways
192+ // just for the sake of completeness.
193+ // TODO: complete this for the remaining types?
190194 if (isNullAt (i )) {
191195 return null ;
196+ } else if (dataType == StringType ) {
197+ return getUTF8String (i );
192198 } else if (dataType == IntegerType ) {
193199 return getInt (i );
194200 } else if (dataType == LongType ) {
@@ -197,8 +203,6 @@ public Object get(int i) {
197203 return getDouble (i );
198204 } else if (dataType == FloatType ) {
199205 return getFloat (i );
200- } else if (dataType == StringType ) {
201- return getUTF8String (i );
202206 } else {
203207 throw new UnsupportedOperationException ();
204208 }
You can’t perform that action at this time.
0 commit comments