From 779992363eed0ff0c74bf8919cfcc33da4cd4324 Mon Sep 17 00:00:00 2001 From: yliuuuu Date: Tue, 16 Jul 2024 10:06:19 -0700 Subject: [PATCH] by_alias --- partiql-ast/api/partiql-ast.api | 52 +++++++++---------- .../src/main/resources/partiql_ast.ion | 4 +- .../partiql/ast/helpers/ToLegacyAstTest.kt | 4 +- .../org/partiql/ast/sql/SqlDialectTest.kt | 4 +- .../parser/internal/PartiQLParserDefault.kt | 8 +-- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/partiql-ast/api/partiql-ast.api b/partiql-ast/api/partiql-ast.api index 347351147..71e3da407 100644 --- a/partiql-ast/api/partiql-ast.api +++ b/partiql-ast/api/partiql-ast.api @@ -58,7 +58,7 @@ public final class org/partiql/ast/Ast { public static final fun exprWindow (Lorg/partiql/ast/Expr$Window$Function;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr$Window$Over;)Lorg/partiql/ast/Expr$Window; public static final fun exprWindowOver (Ljava/util/List;Ljava/util/List;)Lorg/partiql/ast/Expr$Window$Over; public static final fun fromJoin (Lorg/partiql/ast/From;Lorg/partiql/ast/From;Lorg/partiql/ast/From$Join$Type;Lorg/partiql/ast/Expr;)Lorg/partiql/ast/From$Join; - public static final fun fromValue (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/From$Value; + public static final fun fromValue (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/From$Value; public static final fun graphMatch (Ljava/util/List;Lorg/partiql/ast/GraphMatch$Selector;)Lorg/partiql/ast/GraphMatch; public static final fun graphMatchLabelConj (Lorg/partiql/ast/GraphMatch$Label;Lorg/partiql/ast/GraphMatch$Label;)Lorg/partiql/ast/GraphMatch$Label$Conj; public static final fun graphMatchLabelDisj (Lorg/partiql/ast/GraphMatch$Label;Lorg/partiql/ast/GraphMatch$Label;)Lorg/partiql/ast/GraphMatch$Label$Disj; @@ -113,7 +113,7 @@ public final class org/partiql/ast/Ast { public static final fun statementDMLBatchLegacyOpRemove (Lorg/partiql/ast/Path;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Remove; public static final fun statementDMLBatchLegacyOpSet (Ljava/util/List;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Set; public static final fun statementDMLDelete (Lorg/partiql/ast/Statement$DML$Delete$Target;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Returning;)Lorg/partiql/ast/Statement$DML$Delete; - public static final fun statementDMLDeleteTarget (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Statement$DML$Delete$Target; + public static final fun statementDMLDeleteTarget (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Statement$DML$Delete$Target; public static final fun statementDMLInsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$Insert; public static final fun statementDMLInsertLegacy (Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Statement$DML$InsertLegacy; public static final fun statementDMLRemove (Lorg/partiql/ast/Path;)Lorg/partiql/ast/Statement$DML$Remove; @@ -1582,19 +1582,19 @@ public final class org/partiql/ast/From$Value : org/partiql/ast/From { public static final field Companion Lorg/partiql/ast/From$Value$Companion; public final field asAlias Lorg/partiql/ast/Binder; public final field atAlias Lorg/partiql/ast/Binder; - public final field byAlias Lorg/partiql/ast/Identifier$Symbol; + public final field byAlias Lorg/partiql/ast/Binder; public final field expr Lorg/partiql/ast/Expr; public final field type Lorg/partiql/ast/From$Value$Type; - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/ast/builder/FromValueBuilder; public final fun component1 ()Lorg/partiql/ast/Expr; public final fun component2 ()Lorg/partiql/ast/From$Value$Type; public final fun component3 ()Lorg/partiql/ast/Binder; public final fun component4 ()Lorg/partiql/ast/Binder; - public final fun component5 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/From$Value; - public static synthetic fun copy$default (Lorg/partiql/ast/From$Value;Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/From$Value; + public final fun component5 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/From$Value; + public static synthetic fun copy$default (Lorg/partiql/ast/From$Value;Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/From$Value; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -2873,17 +2873,17 @@ public final class org/partiql/ast/Statement$DML$Delete$Target : org/partiql/ast public static final field Companion Lorg/partiql/ast/Statement$DML$Delete$Target$Companion; public final field asAlias Lorg/partiql/ast/Binder; public final field atAlias Lorg/partiql/ast/Binder; - public final field byAlias Lorg/partiql/ast/Identifier$Symbol; + public final field byAlias Lorg/partiql/ast/Binder; public final field path Lorg/partiql/ast/Path; - public fun (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; public final fun component1 ()Lorg/partiql/ast/Path; public final fun component2 ()Lorg/partiql/ast/Binder; public final fun component3 ()Lorg/partiql/ast/Binder; - public final fun component4 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Statement$DML$Delete$Target; - public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Delete$Target;Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Delete$Target; + public final fun component4 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Statement$DML$Delete$Target; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Delete$Target;Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Delete$Target; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -4123,8 +4123,8 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun exprWindowOver$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Expr$Window$Over; public final fun fromJoin (Lorg/partiql/ast/From;Lorg/partiql/ast/From;Lorg/partiql/ast/From$Join$Type;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/From$Join; public static synthetic fun fromJoin$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/From;Lorg/partiql/ast/From;Lorg/partiql/ast/From$Join$Type;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/From$Join; - public final fun fromValue (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/From$Value; - public static synthetic fun fromValue$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/From$Value; + public final fun fromValue (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/From$Value; + public static synthetic fun fromValue$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/From$Value; public final fun graphMatch (Ljava/util/List;Lorg/partiql/ast/GraphMatch$Selector;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/GraphMatch; public static synthetic fun graphMatch$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lorg/partiql/ast/GraphMatch$Selector;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/GraphMatch; public final fun graphMatchLabelConj (Lorg/partiql/ast/GraphMatch$Label;Lorg/partiql/ast/GraphMatch$Label;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/GraphMatch$Label$Conj; @@ -4233,8 +4233,8 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun statementDMLBatchLegacyOpSet$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Set; public final fun statementDMLDelete (Lorg/partiql/ast/Statement$DML$Delete$Target;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Returning;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Delete; public static synthetic fun statementDMLDelete$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Statement$DML$Delete$Target;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Returning;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Delete; - public final fun statementDMLDeleteTarget (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Delete$Target; - public static synthetic fun statementDMLDeleteTarget$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Delete$Target; + public final fun statementDMLDeleteTarget (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Delete$Target; + public static synthetic fun statementDMLDeleteTarget$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Delete$Target; public final fun statementDMLInsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Insert; public static synthetic fun statementDMLInsert$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Insert; public final fun statementDMLInsertLegacy (Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$InsertLegacy; @@ -5125,21 +5125,21 @@ public final class org/partiql/ast/builder/FromJoinBuilder { public final class org/partiql/ast/builder/FromValueBuilder { public fun ()V - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/FromValueBuilder; public final fun atAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/FromValueBuilder; public final fun build ()Lorg/partiql/ast/From$Value; - public final fun byAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/FromValueBuilder; + public final fun byAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/FromValueBuilder; public final fun expr (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/builder/FromValueBuilder; public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getAtAlias ()Lorg/partiql/ast/Binder; - public final fun getByAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getByAlias ()Lorg/partiql/ast/Binder; public final fun getExpr ()Lorg/partiql/ast/Expr; public final fun getType ()Lorg/partiql/ast/From$Value$Type; public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setAtAlias (Lorg/partiql/ast/Binder;)V - public final fun setByAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setByAlias (Lorg/partiql/ast/Binder;)V public final fun setExpr (Lorg/partiql/ast/Expr;)V public final fun setType (Lorg/partiql/ast/From$Value$Type;)V public final fun type (Lorg/partiql/ast/From$Value$Type;)Lorg/partiql/ast/builder/FromValueBuilder; @@ -5778,20 +5778,20 @@ public final class org/partiql/ast/builder/StatementDmlDeleteBuilder { public final class org/partiql/ast/builder/StatementDmlDeleteTargetBuilder { public fun ()V - public fun (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/Path;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; public final fun atAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; public final fun build ()Lorg/partiql/ast/Statement$DML$Delete$Target; - public final fun byAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; + public final fun byAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getAtAlias ()Lorg/partiql/ast/Binder; - public final fun getByAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getByAlias ()Lorg/partiql/ast/Binder; public final fun getPath ()Lorg/partiql/ast/Path; public final fun path (Lorg/partiql/ast/Path;)Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setAtAlias (Lorg/partiql/ast/Binder;)V - public final fun setByAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setByAlias (Lorg/partiql/ast/Binder;)V public final fun setPath (Lorg/partiql/ast/Path;)V } diff --git a/partiql-ast/src/main/resources/partiql_ast.ion b/partiql-ast/src/main/resources/partiql_ast.ion index 3c375836c..8a34a03fa 100644 --- a/partiql-ast/src/main/resources/partiql_ast.ion +++ b/partiql-ast/src/main/resources/partiql_ast.ion @@ -67,7 +67,7 @@ statement::[ path: path, as_alias: optional::binder, at_alias: optional::binder, - by_alias: optional::'.identifier.symbol', + by_alias: optional::binder, }, where: optional::expr, returning: optional::returning, @@ -639,7 +639,7 @@ from::[ type: [ SCAN, UNPIVOT ], as_alias: optional::binder, at_alias: optional::binder, - by_alias: optional::'.identifier.symbol', + by_alias: optional::binder, }, // TODO https://github.com/partiql/partiql-spec/issues/41 diff --git a/partiql-ast/src/test/kotlin/org/partiql/ast/helpers/ToLegacyAstTest.kt b/partiql-ast/src/test/kotlin/org/partiql/ast/helpers/ToLegacyAstTest.kt index 79a0b47f5..b2ae55d02 100644 --- a/partiql-ast/src/test/kotlin/org/partiql/ast/helpers/ToLegacyAstTest.kt +++ b/partiql-ast/src/test/kotlin/org/partiql/ast/helpers/ToLegacyAstTest.kt @@ -585,7 +585,7 @@ class ToLegacyAstTest { type = From.Value.Type.SCAN asAlias = bindName("a") atAlias = bindName("b") - byAlias = id("c") + byAlias = bindName("c") } }, expect("(unpivot (lit null) null null null)") { @@ -600,7 +600,7 @@ class ToLegacyAstTest { type = From.Value.Type.UNPIVOT asAlias = bindName("a") atAlias = bindName("b") - byAlias = id("c") + byAlias = bindName("c") } }, expect( diff --git a/partiql-ast/src/test/kotlin/org/partiql/ast/sql/SqlDialectTest.kt b/partiql-ast/src/test/kotlin/org/partiql/ast/sql/SqlDialectTest.kt index fe9c61dc6..5ad2235a2 100644 --- a/partiql-ast/src/test/kotlin/org/partiql/ast/sql/SqlDialectTest.kt +++ b/partiql-ast/src/test/kotlin/org/partiql/ast/sql/SqlDialectTest.kt @@ -1229,7 +1229,7 @@ class SqlDialectTest { type = From.Value.Type.SCAN asAlias = bindName("x") atAlias = bindName("y") - byAlias = id("z") + byAlias = bindName("z") } } }, @@ -1271,7 +1271,7 @@ class SqlDialectTest { type = From.Value.Type.UNPIVOT asAlias = bindName("x") atAlias = bindName("y") - byAlias = id("z") + byAlias = bindName("z") } } }, diff --git a/partiql-parser/src/main/kotlin/org/partiql/parser/internal/PartiQLParserDefault.kt b/partiql-parser/src/main/kotlin/org/partiql/parser/internal/PartiQLParserDefault.kt index bfb62b750..c60af4439 100644 --- a/partiql-parser/src/main/kotlin/org/partiql/parser/internal/PartiQLParserDefault.kt +++ b/partiql-parser/src/main/kotlin/org/partiql/parser/internal/PartiQLParserDefault.kt @@ -1472,7 +1472,7 @@ internal class PartiQLParserDefault : PartiQLParser { val expr = visitAs(ctx.source) val asAlias = ctx.asIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } val atAlias = ctx.atIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } - val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } + val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } fromValue(expr, From.Value.Type.SCAN, asAlias, atAlias, byAlias) } @@ -1480,7 +1480,7 @@ internal class PartiQLParserDefault : PartiQLParser { val expr = visitAs(ctx.source) val asAlias = ctx.asIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } val atAlias = ctx.atIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } - val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } + val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } fromValue(expr, From.Value.Type.SCAN, asAlias, atAlias, byAlias) } @@ -1492,7 +1492,7 @@ internal class PartiQLParserDefault : PartiQLParser { val path = visitPathSimple(ctx.pathSimple()) val asAlias = ctx.asIdent()?.let { visitAsIdent(it).asBinder() } val atAlias = ctx.atIdent()?.let { visitAtIdent(it).asBinder() } - val byAlias = ctx.byIdent()?.let { visitByIdent(it) } + val byAlias = ctx.byIdent()?.let { visitByIdent(it).asBinder() } statementDMLDeleteTarget(path, asAlias, atAlias, byAlias) } @@ -1510,7 +1510,7 @@ internal class PartiQLParserDefault : PartiQLParser { val expr = visitAs(ctx.expr()) val asAlias = ctx.asIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } val atAlias = ctx.atIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } - val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } + val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()).asBinder() } fromValue(expr, From.Value.Type.UNPIVOT, asAlias, atAlias, byAlias) }