rahil-c commented on code in PR #18488:
URL: https://github.com/apache/hudi/pull/18488#discussion_r3067679048
##########
hudi-spark-datasource/hudi-spark3.4.x/src/main/scala/org/apache/spark/sql/parser/HoodieSpark3_4ExtendedSqlAstBuilder.scala:
##########
@@ -2705,8 +2720,13 @@ class HoodieSpark3_4ExtendedSqlAstBuilder(conf: SQLConf,
delegate: ParserInterfa
private def addMetadataForType(dataType:
HoodieSqlBaseParser.DataTypeContext, builder: MetadataBuilder): Unit = {
val typeText = dataType.getText
- if (typeText.equalsIgnoreCase(HoodieSchemaType.BLOB.name())) {
+ val upperTypeText = typeText.toUpperCase(Locale.ROOT)
+ if (upperTypeText == HoodieSchemaType.BLOB.name()) {
builder.putString(HoodieSchema.TYPE_METADATA_FIELD,
HoodieSchemaType.BLOB.name())
+ } else if (upperTypeText.startsWith("VECTOR(")) {
+ // Normalize to canonical form (e.g. "VECTOR(128,FLOAT)" ->
"VECTOR(128)")
+ val vectorSchema =
HoodieSchema.parseTypeDescriptor(typeText).asInstanceOf[HoodieSchema.Vector]
Review Comment:
does the invocation of `parseTypeDescriptor` require a try catch similar to
the first call?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]