@@ -217,7 +217,7 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
217217 */
218218 override def visitPropertyKey (key : PropertyKeyContext ): String = {
219219 if (key.stringLit() != null ) {
220- string( visitStringLit(key.stringLit() ))
220+ visitStringLit(key.stringLit())
221221 } else {
222222 key.getText
223223 }
@@ -233,24 +233,24 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
233233 } else if (value.identifier != null ) {
234234 value.identifier.getText
235235 } else if (value.value != null ) {
236- string( visitStringLit(value.value) )
236+ visitStringLit(value.value)
237237 } else if (value.booleanValue != null ) {
238238 value.getText.toLowerCase(Locale .ROOT )
239239 } else {
240240 value.getText
241241 }
242242 }
243243
244- override def visitStringLit (ctx : StringLitContext ): Token = {
245- if (ctx != null ) {
246- if (ctx.STRING != null ) {
247- ctx.STRING .getSymbol
244+ override def visitStringLit (ctx : StringLitContext ): String = {
245+ if (ctx == null ) return null
246+ ctx.singleStringLit().asScala.map { singleCtx =>
247+ val token = if (singleCtx.STRING != null ) {
248+ singleCtx.STRING .getSymbol
248249 } else {
249- ctx .DOUBLEQUOTED_STRING .getSymbol
250+ singleCtx .DOUBLEQUOTED_STRING .getSymbol
250251 }
251- } else {
252- null
253- }
252+ string(token)
253+ }.mkString
254254 }
255255
256256 /**
@@ -311,7 +311,7 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
311311 isReplace,
312312 isCreate,
313313 tablePropertyOverrides,
314- Option (ctx.location).map(s => string( visitStringLit(s)) ))
314+ Option (ctx.location).map(visitStringLit))
315315 }
316316
317317 /**
@@ -336,7 +336,7 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
336336 }
337337 }
338338 VacuumTableCommand (
339- path = Option (ctx.path).map(string ),
339+ path = Option (ctx.path).map(visitStringLit ),
340340 table = Option (ctx.table).map(visitTableIdentifier),
341341 inventoryTable = ctx.vacuumModifiers().inventory().asScala.headOption.collect {
342342 case i if i.inventoryTable != null => visitTableIdentifier(i.inventoryTable)
@@ -389,7 +389,7 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
389389 }
390390 val interleaveBy = Option (ctx.zorderSpec).map(visitZorderSpec).getOrElse(Seq .empty)
391391 OptimizeTableCommand (
392- Option (ctx.path).map(string ),
392+ Option (ctx.path).map(visitStringLit ),
393393 Option (ctx.table).map(visitTableIdentifier),
394394 Option (ctx.partitionPredicate).map(extractRawText(_)).toSeq,
395395 DeltaOptimizeContext (isFull = ctx.FULL != null ))(interleaveBy)
@@ -437,15 +437,15 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
437437 override def visitDescribeDeltaDetail (
438438 ctx : DescribeDeltaDetailContext ): LogicalPlan = withOrigin(ctx) {
439439 DescribeDeltaDetailCommand (
440- Option (ctx.path).map(string ),
440+ Option (ctx.path).map(visitStringLit ),
441441 Option (ctx.table).map(visitTableIdentifier),
442442 Map .empty)
443443 }
444444
445445 override def visitDescribeDeltaHistory (
446446 ctx : DescribeDeltaHistoryContext ): LogicalPlan = withOrigin(ctx) {
447447 DescribeDeltaHistory (
448- Option (ctx.path).map(string ),
448+ Option (ctx.path).map(visitStringLit ),
449449 Option (ctx.table).map(visitTableIdentifier),
450450 Option (ctx.limit).map(_.getText.toInt))
451451 }
@@ -602,7 +602,7 @@ class DeltaSqlAstBuilder extends DeltaSqlBaseBaseVisitor[AnyRef] {
602602 */
603603 override def visitFeatureNameValue (featureNameValue : FeatureNameValueContext ): String = {
604604 if (featureNameValue.stringLit() != null ) {
605- string( visitStringLit(featureNameValue.stringLit() ))
605+ visitStringLit(featureNameValue.stringLit())
606606 } else {
607607 featureNameValue.getText
608608 }
0 commit comments