Skip to content

Commit 45219bb

Browse files
committed
Fix UT
Signed-off-by: Peng Huo <[email protected]>
1 parent 2c43106 commit 45219bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

flint-spark-integration/src/main/scala/org/apache/spark/sql/flint/datatype/FlintMetadataExtensions.scala

+7-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@ object FlintMetadataExtensions {
4040
def keywordSubfield: Option[String] = {
4141
if (metadata.contains(FIELDS_NAMES_KEY)) {
4242
val multiFieldMetadata = metadata.getMetadata(FIELDS_NAMES_KEY)
43-
multiFieldMetadata
44-
.getStringArray(KEYWORD_TYPE)
45-
.headOption
43+
if (multiFieldMetadata.contains(KEYWORD_TYPE)) {
44+
multiFieldMetadata
45+
.getStringArray(KEYWORD_TYPE)
46+
.headOption
47+
} else {
48+
None
49+
}
4650
} else {
4751
None
4852
}

0 commit comments

Comments
 (0)