diff --git a/partiql-ast/api/partiql-ast.api b/partiql-ast/api/partiql-ast.api index 688c53ecf2..c90a11d462 100644 --- a/partiql-ast/api/partiql-ast.api +++ b/partiql-ast/api/partiql-ast.api @@ -1,4 +1,5 @@ public final class org/partiql/ast/Ast { + public static final fun binder (Ljava/lang/String;Z)Lorg/partiql/ast/Binder; public static final fun constraint (Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;)Lorg/partiql/ast/Constraint; public static final fun constraintDefinitionCheck (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Constraint$Definition$Check; public static final fun constraintDefinitionNotNull ()Lorg/partiql/ast/Constraint$Definition$NotNull; @@ -57,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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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; @@ -75,12 +76,12 @@ public final class org/partiql/ast/Ast { public static final fun graphMatchSelectorAnyShortest ()Lorg/partiql/ast/GraphMatch$Selector$AnyShortest; public static final fun graphMatchSelectorShortestK (J)Lorg/partiql/ast/GraphMatch$Selector$ShortestK; public static final fun graphMatchSelectorShortestKGroup (J)Lorg/partiql/ast/GraphMatch$Selector$ShortestKGroup; - public static final fun groupBy (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/GroupBy; - public static final fun groupByKey (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/GroupBy$Key; + public static final fun groupBy (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/GroupBy; + public static final fun groupByKey (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/GroupBy$Key; public static final fun identifierQualified (Lorg/partiql/ast/Identifier$Symbol;Ljava/util/List;)Lorg/partiql/ast/Identifier$Qualified; public static final fun identifierSymbol (Ljava/lang/String;Lorg/partiql/ast/Identifier$CaseSensitivity;)Lorg/partiql/ast/Identifier$Symbol; public static final fun let (Ljava/util/List;)Lorg/partiql/ast/Let; - public static final fun letBinding (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Let$Binding; + public static final fun letBinding (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Let$Binding; public static final fun onConflict (Lorg/partiql/ast/OnConflict$Target;Lorg/partiql/ast/OnConflict$Action;)Lorg/partiql/ast/OnConflict; public static final fun onConflictActionDoNothing ()Lorg/partiql/ast/OnConflict$Action$DoNothing; public static final fun onConflictActionDoReplace (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/OnConflict$Action$DoReplace; @@ -99,7 +100,7 @@ public final class org/partiql/ast/Ast { public static final fun selectPivot (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Select$Pivot; public static final fun selectProject (Ljava/util/List;Lorg/partiql/ast/SetQuantifier;)Lorg/partiql/ast/Select$Project; public static final fun selectProjectItemAll (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Select$Project$Item$All; - public static final fun selectProjectItemExpression (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Select$Project$Item$Expression; + public static final fun selectProjectItemExpression (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Select$Project$Item$Expression; public static final fun selectStar (Lorg/partiql/ast/SetQuantifier;)Lorg/partiql/ast/Select$Star; public static final fun selectValue (Lorg/partiql/ast/Expr;Lorg/partiql/ast/SetQuantifier;)Lorg/partiql/ast/Select$Value; public static final fun setOp (Lorg/partiql/ast/SetOp$Type;Lorg/partiql/ast/SetQuantifier;)Lorg/partiql/ast/SetOp; @@ -107,19 +108,19 @@ public final class org/partiql/ast/Ast { public static final fun statementDDL (Lorg/partiql/ast/DdlOp;)Lorg/partiql/ast/Statement$DDL; public static final fun statementDMLBatchLegacy (Ljava/util/List;Lorg/partiql/ast/From;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Returning;)Lorg/partiql/ast/Statement$DML$BatchLegacy; public static final fun statementDMLBatchLegacyOpDelete ()Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Delete; - public static final fun statementDMLBatchLegacyOpInsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; + public static final fun statementDMLBatchLegacyOpInsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; public static final fun statementDMLBatchLegacyOpInsertLegacy (Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$InsertLegacy; 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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Statement$DML$Delete$Target; - public static final fun statementDMLInsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$Insert; + 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; - public static final fun statementDMLReplace (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Statement$DML$Replace; + public static final fun statementDMLReplace (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Statement$DML$Replace; public static final fun statementDMLUpdate (Lorg/partiql/ast/Path;Ljava/util/List;)Lorg/partiql/ast/Statement$DML$Update; public static final fun statementDMLUpdateAssignment (Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Statement$DML$Update$Assignment; - public static final fun statementDMLUpsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Statement$DML$Upsert; + public static final fun statementDMLUpsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Statement$DML$Upsert; public static final fun statementExec (Ljava/lang/String;Ljava/util/List;)Lorg/partiql/ast/Statement$Exec; public static final fun statementExplain (Lorg/partiql/ast/Statement$Explain$Target;)Lorg/partiql/ast/Statement$Explain; public static final fun statementExplainTargetDomain (Lorg/partiql/ast/Statement;Ljava/lang/String;Ljava/lang/String;)Lorg/partiql/ast/Statement$Explain$Target$Domain; @@ -157,7 +158,7 @@ public final class org/partiql/ast/Ast { public static final fun typeSmallint ()Lorg/partiql/ast/Type$Smallint; public static final fun typeString (Ljava/lang/Integer;)Lorg/partiql/ast/Type$String; public static final fun typeStruct (Ljava/util/List;)Lorg/partiql/ast/Type$Struct; - public static final fun typeStructField (Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;)Lorg/partiql/ast/Type$Struct$Field; + public static final fun typeStructField (Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;)Lorg/partiql/ast/Type$Struct$Field; public static final fun typeSymbol ()Lorg/partiql/ast/Type$Symbol; public static final fun typeTime (Ljava/lang/Integer;)Lorg/partiql/ast/Type$Time; public static final fun typeTimeWithTz (Ljava/lang/Integer;)Lorg/partiql/ast/Type$TimeWithTz; @@ -175,6 +176,27 @@ public abstract class org/partiql/ast/AstNode { public abstract fun getChildren ()Ljava/util/List; } +public final class org/partiql/ast/Binder : org/partiql/ast/AstNode { + public static final field Companion Lorg/partiql/ast/Binder$Companion; + public final field isRegular Z + public final field symbol Ljava/lang/String; + public fun (Ljava/lang/String;Z)V + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; + public static final fun builder ()Lorg/partiql/ast/builder/BinderBuilder; + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Z + public final fun copy (Ljava/lang/String;Z)Lorg/partiql/ast/Binder; + public static synthetic fun copy$default (Lorg/partiql/ast/Binder;Ljava/lang/String;ZILjava/lang/Object;)Lorg/partiql/ast/Binder; + public fun equals (Ljava/lang/Object;)Z + public fun getChildren ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class org/partiql/ast/Binder$Companion { + public final fun builder ()Lorg/partiql/ast/builder/BinderBuilder; +} + public final class org/partiql/ast/Constraint : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/Constraint$Companion; public final field definition Lorg/partiql/ast/Constraint$Definition; @@ -1551,21 +1573,21 @@ public final class org/partiql/ast/From$Join$Type : java/lang/Enum { 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/Identifier$Symbol; - public final field atAlias Lorg/partiql/ast/Identifier$Symbol; - public final field byAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; + public final field atAlias Lorg/partiql/ast/Binder; + 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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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/Identifier$Symbol; - public final fun component4 ()Lorg/partiql/ast/Identifier$Symbol; - 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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/From$Value; + public final fun component3 ()Lorg/partiql/ast/Binder; + public final fun component4 ()Lorg/partiql/ast/Binder; + 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 @@ -1976,17 +1998,17 @@ public final class org/partiql/ast/GraphMatch$Selector$ShortestKGroup$Companion public final class org/partiql/ast/GroupBy : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/GroupBy$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field keys Ljava/util/List; public final field strategy Lorg/partiql/ast/GroupBy$Strategy; - public fun (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;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/GroupByBuilder; public final fun component1 ()Lorg/partiql/ast/GroupBy$Strategy; public final fun component2 ()Ljava/util/List; - public final fun component3 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/GroupBy; - public static synthetic fun copy$default (Lorg/partiql/ast/GroupBy;Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy; + public final fun component3 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/GroupBy; + public static synthetic fun copy$default (Lorg/partiql/ast/GroupBy;Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -1999,15 +2021,15 @@ public final class org/partiql/ast/GroupBy$Companion { public final class org/partiql/ast/GroupBy$Key : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/GroupBy$Key$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field expr Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/Expr;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/GroupByKeyBuilder; public final fun component1 ()Lorg/partiql/ast/Expr; - public final fun component2 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/GroupBy$Key; - public static synthetic fun copy$default (Lorg/partiql/ast/GroupBy$Key;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy$Key; + public final fun component2 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/GroupBy$Key; + public static synthetic fun copy$default (Lorg/partiql/ast/GroupBy$Key;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy$Key; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -2095,15 +2117,15 @@ public final class org/partiql/ast/Let : org/partiql/ast/AstNode { public final class org/partiql/ast/Let$Binding : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/Let$Binding$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field expr Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/Expr;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/LetBindingBuilder; public final fun component1 ()Lorg/partiql/ast/Expr; - public final fun component2 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Let$Binding; - public static synthetic fun copy$default (Lorg/partiql/ast/Let$Binding;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/Let$Binding; + public final fun component2 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Let$Binding; + public static synthetic fun copy$default (Lorg/partiql/ast/Let$Binding;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/Let$Binding; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -2520,15 +2542,15 @@ public final class org/partiql/ast/Select$Project$Item$All$Companion { public final class org/partiql/ast/Select$Project$Item$Expression : org/partiql/ast/Select$Project$Item { public static final field Companion Lorg/partiql/ast/Select$Project$Item$Expression$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field expr Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/Expr;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/SelectProjectItemExpressionBuilder; public final fun component1 ()Lorg/partiql/ast/Expr; - public final fun component2 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Select$Project$Item$Expression; - public static synthetic fun copy$default (Lorg/partiql/ast/Select$Project$Item$Expression;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/Select$Project$Item$Expression; + public final fun component2 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Select$Project$Item$Expression; + public static synthetic fun copy$default (Lorg/partiql/ast/Select$Project$Item$Expression;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/Select$Project$Item$Expression; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -2731,19 +2753,19 @@ public final class org/partiql/ast/Statement$DML$BatchLegacy$Op$Delete$Companion public final class org/partiql/ast/Statement$DML$BatchLegacy$Op$Insert : org/partiql/ast/Statement$DML$BatchLegacy$Op { public static final field Companion Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field onConflict Lorg/partiql/ast/OnConflict; public final field target Lorg/partiql/ast/Identifier; public final field values Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)V + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/ast/builder/StatementDmlBatchLegacyOpInsertBuilder; public final fun component1 ()Lorg/partiql/ast/Identifier; public final fun component2 ()Lorg/partiql/ast/Expr; - public final fun component3 ()Lorg/partiql/ast/Identifier$Symbol; + public final fun component3 ()Lorg/partiql/ast/Binder; public final fun component4 ()Lorg/partiql/ast/OnConflict; - public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; - public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; + public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -2842,19 +2864,19 @@ public final class org/partiql/ast/Statement$DML$Delete$Companion { public final class org/partiql/ast/Statement$DML$Delete$Target : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/Statement$DML$Delete$Target$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; - public final field atAlias Lorg/partiql/ast/Identifier$Symbol; - public final field byAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; + public final field atAlias Lorg/partiql/ast/Binder; + 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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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/Identifier$Symbol; - public final fun component3 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun component4 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Path;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Delete$Target; + public final fun component2 ()Lorg/partiql/ast/Binder; + public final fun component3 ()Lorg/partiql/ast/Binder; + 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 @@ -2867,19 +2889,19 @@ public final class org/partiql/ast/Statement$DML$Delete$Target$Companion { public final class org/partiql/ast/Statement$DML$Insert : org/partiql/ast/Statement$DML { public static final field Companion Lorg/partiql/ast/Statement$DML$Insert$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field onConflict Lorg/partiql/ast/OnConflict; public final field target Lorg/partiql/ast/Identifier; public final field values Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)V + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/ast/builder/StatementDmlInsertBuilder; public final fun component1 ()Lorg/partiql/ast/Identifier; public final fun component2 ()Lorg/partiql/ast/Expr; - public final fun component3 ()Lorg/partiql/ast/Identifier$Symbol; + public final fun component3 ()Lorg/partiql/ast/Binder; public final fun component4 ()Lorg/partiql/ast/OnConflict; - public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$Insert; - public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Insert;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Insert; + public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/Statement$DML$Insert; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Insert;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Insert; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -2936,17 +2958,17 @@ public final class org/partiql/ast/Statement$DML$Remove$Companion { public final class org/partiql/ast/Statement$DML$Replace : org/partiql/ast/Statement$DML { public static final field Companion Lorg/partiql/ast/Statement$DML$Replace$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field target Lorg/partiql/ast/Identifier; public final field values Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;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/StatementDmlReplaceBuilder; public final fun component1 ()Lorg/partiql/ast/Identifier; public final fun component2 ()Lorg/partiql/ast/Expr; - public final fun component3 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Statement$DML$Replace; - public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Replace;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Replace; + public final fun component3 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Statement$DML$Replace; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Replace;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Replace; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -3001,17 +3023,17 @@ public final class org/partiql/ast/Statement$DML$Update$Companion { public final class org/partiql/ast/Statement$DML$Upsert : org/partiql/ast/Statement$DML { public static final field Companion Lorg/partiql/ast/Statement$DML$Upsert$Companion; - public final field asAlias Lorg/partiql/ast/Identifier$Symbol; + public final field asAlias Lorg/partiql/ast/Binder; public final field target Lorg/partiql/ast/Identifier; public final field values Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;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/StatementDmlUpsertBuilder; public final fun component1 ()Lorg/partiql/ast/Identifier; public final fun component2 ()Lorg/partiql/ast/Expr; - public final fun component3 ()Lorg/partiql/ast/Identifier$Symbol; - public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Statement$DML$Upsert; - public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Upsert;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Upsert; + public final fun component3 ()Lorg/partiql/ast/Binder; + public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)Lorg/partiql/ast/Statement$DML$Upsert; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DML$Upsert;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Upsert; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -3794,18 +3816,18 @@ public final class org/partiql/ast/Type$Struct$Field : org/partiql/ast/AstNode { public final field comment Ljava/lang/String; public final field constraints Ljava/util/List; public final field isOptional Z - public final field name Lorg/partiql/ast/Identifier$Symbol; + public final field name Lorg/partiql/ast/Binder; public final field type Lorg/partiql/ast/Type; - public fun (Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;)V + public fun (Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/ast/builder/TypeStructFieldBuilder; - public final fun component1 ()Lorg/partiql/ast/Identifier$Symbol; + public final fun component1 ()Lorg/partiql/ast/Binder; public final fun component2 ()Lorg/partiql/ast/Type; public final fun component3 ()Ljava/util/List; public final fun component4 ()Z public final fun component5 ()Ljava/lang/String; - public final fun copy (Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;)Lorg/partiql/ast/Type$Struct$Field; - public static synthetic fun copy$default (Lorg/partiql/ast/Type$Struct$Field;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;ILjava/lang/Object;)Lorg/partiql/ast/Type$Struct$Field; + public final fun copy (Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;)Lorg/partiql/ast/Type$Struct$Field; + public static synthetic fun copy$default (Lorg/partiql/ast/Type$Struct$Field;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;ILjava/lang/Object;)Lorg/partiql/ast/Type$Struct$Field; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -3976,6 +3998,8 @@ public final class org/partiql/ast/Type$Varchar$Companion { public final class org/partiql/ast/builder/AstBuilder { public fun ()V + public final fun binder (Ljava/lang/String;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Binder; + public static synthetic fun binder$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/String;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Binder; public final fun constraint (Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Constraint; public static synthetic fun constraint$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Constraint; public final fun constraintDefinitionCheck (Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Constraint$Definition$Check; @@ -4092,8 +4116,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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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; @@ -4128,18 +4152,18 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun graphMatchSelectorShortestK$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/Long;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/GraphMatch$Selector$ShortestK; public final fun graphMatchSelectorShortestKGroup (Ljava/lang/Long;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/GraphMatch$Selector$ShortestKGroup; public static synthetic fun graphMatchSelectorShortestKGroup$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/Long;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/GraphMatch$Selector$ShortestKGroup; - public final fun groupBy (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/GroupBy; - public static synthetic fun groupBy$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy; - public final fun groupByKey (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/GroupBy$Key; - public static synthetic fun groupByKey$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy$Key; + public final fun groupBy (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/GroupBy; + public static synthetic fun groupBy$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy; + public final fun groupByKey (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/GroupBy$Key; + public static synthetic fun groupByKey$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/GroupBy$Key; public final fun identifierQualified (Lorg/partiql/ast/Identifier$Symbol;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Identifier$Qualified; public static synthetic fun identifierQualified$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier$Symbol;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Identifier$Qualified; public final fun identifierSymbol (Ljava/lang/String;Lorg/partiql/ast/Identifier$CaseSensitivity;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Identifier$Symbol; public static synthetic fun identifierSymbol$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/String;Lorg/partiql/ast/Identifier$CaseSensitivity;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Identifier$Symbol; public final fun let (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Let; public static synthetic fun let$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Let; - public final fun letBinding (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Let$Binding; - public static synthetic fun letBinding$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Let$Binding; + public final fun letBinding (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Let$Binding; + public static synthetic fun letBinding$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Let$Binding; public final fun onConflict (Lorg/partiql/ast/OnConflict$Target;Lorg/partiql/ast/OnConflict$Action;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/OnConflict; public static synthetic fun onConflict$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/OnConflict$Target;Lorg/partiql/ast/OnConflict$Action;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/OnConflict; public final fun onConflictActionDoNothing (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/OnConflict$Action$DoNothing; @@ -4176,8 +4200,8 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun selectProject$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lorg/partiql/ast/SetQuantifier;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Select$Project; public final fun selectProjectItemAll (Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Select$Project$Item$All; public static synthetic fun selectProjectItemAll$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Select$Project$Item$All; - public final fun selectProjectItemExpression (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Select$Project$Item$Expression; - public static synthetic fun selectProjectItemExpression$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Select$Project$Item$Expression; + public final fun selectProjectItemExpression (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Select$Project$Item$Expression; + public static synthetic fun selectProjectItemExpression$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Select$Project$Item$Expression; public final fun selectStar (Lorg/partiql/ast/SetQuantifier;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Select$Star; public static synthetic fun selectStar$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/SetQuantifier;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Select$Star; public final fun selectValue (Lorg/partiql/ast/Expr;Lorg/partiql/ast/SetQuantifier;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Select$Value; @@ -4192,8 +4216,8 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun statementDMLBatchLegacy$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lorg/partiql/ast/From;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Returning;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$BatchLegacy; public final fun statementDMLBatchLegacyOpDelete (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Delete; public static synthetic fun statementDMLBatchLegacyOpDelete$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Delete; - public final fun statementDMLBatchLegacyOpInsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; - public static synthetic fun statementDMLBatchLegacyOpInsert$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; + public final fun statementDMLBatchLegacyOpInsert (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$BatchLegacy$Op$Insert; + public static synthetic fun statementDMLBatchLegacyOpInsert$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$BatchLegacy$Op$Insert; public final fun statementDMLBatchLegacyOpInsertLegacy (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$BatchLegacy$Op$InsertLegacy; public static synthetic fun statementDMLBatchLegacyOpInsertLegacy$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$InsertLegacy; public final fun statementDMLBatchLegacyOpRemove (Lorg/partiql/ast/Path;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Remove; @@ -4202,22 +4226,22 @@ 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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;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/Identifier$Symbol;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/Identifier$Symbol;Lorg/partiql/ast/OnConflict;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Insert; + 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; public static synthetic fun statementDMLInsertLegacy$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$InsertLegacy; public final fun statementDMLRemove (Lorg/partiql/ast/Path;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Remove; public static synthetic fun statementDMLRemove$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Path;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Remove; - public final fun statementDMLReplace (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Replace; - public static synthetic fun statementDMLReplace$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Replace; + public final fun statementDMLReplace (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Replace; + public static synthetic fun statementDMLReplace$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Replace; public final fun statementDMLUpdate (Lorg/partiql/ast/Path;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Update; public static synthetic fun statementDMLUpdate$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Path;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Update; public final fun statementDMLUpdateAssignment (Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Update$Assignment; public static synthetic fun statementDMLUpdateAssignment$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Path;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Update$Assignment; - public final fun statementDMLUpsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Upsert; - public static synthetic fun statementDMLUpsert$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Upsert; + public final fun statementDMLUpsert (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$Upsert; + public static synthetic fun statementDMLUpsert$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DML$Upsert; public final fun statementExec (Ljava/lang/String;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$Exec; public static synthetic fun statementExec$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/String;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$Exec; public final fun statementExplain (Lorg/partiql/ast/Statement$Explain$Target;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$Explain; @@ -4292,8 +4316,8 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun typeString$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$String; public final fun typeStruct (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Struct; public static synthetic fun typeStruct$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Struct; - public final fun typeStructField (Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Struct$Field; - public static synthetic fun typeStructField$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Struct$Field; + public final fun typeStructField (Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Struct$Field; + public static synthetic fun typeStructField$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Struct$Field; public final fun typeSymbol (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Symbol; public static synthetic fun typeSymbol$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Symbol; public final fun typeTime (Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Time; @@ -4316,6 +4340,19 @@ public final class org/partiql/ast/builder/AstBuilderKt { public static final fun ast (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/AstNode; } +public final class org/partiql/ast/builder/BinderBuilder { + public fun ()V + public fun (Ljava/lang/String;Ljava/lang/Boolean;)V + public synthetic fun (Ljava/lang/String;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/Binder; + public final fun getSymbol ()Ljava/lang/String; + public final fun isRegular ()Ljava/lang/Boolean; + public final fun isRegular (Ljava/lang/Boolean;)Lorg/partiql/ast/builder/BinderBuilder; + public final fun setRegular (Ljava/lang/Boolean;)V + public final fun setSymbol (Ljava/lang/String;)V + public final fun symbol (Ljava/lang/String;)Lorg/partiql/ast/builder/BinderBuilder; +} + public final class org/partiql/ast/builder/ConstraintBuilder { public fun ()V public fun (Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;)V @@ -5081,21 +5118,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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/From$Value$Type;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/FromValueBuilder; - public final fun atAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/FromValueBuilder; + 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/Identifier$Symbol; - public final fun getAtAlias ()Lorg/partiql/ast/Identifier$Symbol; - public final fun getByAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; + public final fun getAtAlias ()Lorg/partiql/ast/Binder; + 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/Identifier$Symbol;)V - public final fun setAtAlias (Lorg/partiql/ast/Identifier$Symbol;)V - public final fun setByAlias (Lorg/partiql/ast/Identifier$Symbol;)V + 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/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; @@ -5295,15 +5332,15 @@ public final class org/partiql/ast/builder/GraphMatchSelectorShortestKGroupBuild public final class org/partiql/ast/builder/GroupByBuilder { public fun ()V - public fun (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/GroupByBuilder; + public fun (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/GroupBy$Strategy;Ljava/util/List;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/GroupByBuilder; public final fun build ()Lorg/partiql/ast/GroupBy; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getKeys ()Ljava/util/List; public final fun getStrategy ()Lorg/partiql/ast/GroupBy$Strategy; public final fun keys (Ljava/util/List;)Lorg/partiql/ast/builder/GroupByBuilder; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setKeys (Ljava/util/List;)V public final fun setStrategy (Lorg/partiql/ast/GroupBy$Strategy;)V public final fun strategy (Lorg/partiql/ast/GroupBy$Strategy;)Lorg/partiql/ast/builder/GroupByBuilder; @@ -5311,14 +5348,14 @@ public final class org/partiql/ast/builder/GroupByBuilder { public final class org/partiql/ast/builder/GroupByKeyBuilder { public fun ()V - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/GroupByKeyBuilder; + public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/GroupByKeyBuilder; public final fun build ()Lorg/partiql/ast/GroupBy$Key; public final fun expr (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/builder/GroupByKeyBuilder; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getExpr ()Lorg/partiql/ast/Expr; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setExpr (Lorg/partiql/ast/Expr;)V } @@ -5350,14 +5387,14 @@ public final class org/partiql/ast/builder/IdentifierSymbolBuilder { public final class org/partiql/ast/builder/LetBindingBuilder { public fun ()V - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/LetBindingBuilder; + public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/LetBindingBuilder; public final fun build ()Lorg/partiql/ast/Let$Binding; public final fun expr (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/builder/LetBindingBuilder; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getExpr ()Lorg/partiql/ast/Expr; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setExpr (Lorg/partiql/ast/Expr;)V } @@ -5561,14 +5598,14 @@ public final class org/partiql/ast/builder/SelectProjectItemAllBuilder { public final class org/partiql/ast/builder/SelectProjectItemExpressionBuilder { public fun ()V - public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/SelectProjectItemExpressionBuilder; + public fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/SelectProjectItemExpressionBuilder; public final fun build ()Lorg/partiql/ast/Select$Project$Item$Expression; public final fun expr (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/builder/SelectProjectItemExpressionBuilder; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getExpr ()Lorg/partiql/ast/Expr; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setExpr (Lorg/partiql/ast/Expr;)V } @@ -5660,16 +5697,16 @@ public final class org/partiql/ast/builder/StatementDmlBatchLegacyOpDeleteBuilde public final class org/partiql/ast/builder/StatementDmlBatchLegacyOpInsertBuilder { public fun ()V - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)V - public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/StatementDmlBatchLegacyOpInsertBuilder; + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)V + public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/StatementDmlBatchLegacyOpInsertBuilder; public final fun build ()Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Insert; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getOnConflict ()Lorg/partiql/ast/OnConflict; public final fun getTarget ()Lorg/partiql/ast/Identifier; public final fun getValues ()Lorg/partiql/ast/Expr; public final fun onConflict (Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/builder/StatementDmlBatchLegacyOpInsertBuilder; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setOnConflict (Lorg/partiql/ast/OnConflict;)V public final fun setTarget (Lorg/partiql/ast/Identifier;)V public final fun setValues (Lorg/partiql/ast/Expr;)V @@ -5734,35 +5771,35 @@ 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/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Path;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; - public final fun atAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/StatementDmlDeleteTargetBuilder; + 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 getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; - public final fun getAtAlias ()Lorg/partiql/ast/Identifier$Symbol; - public final fun getByAlias ()Lorg/partiql/ast/Identifier$Symbol; + 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/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/Identifier$Symbol;)V - public final fun setAtAlias (Lorg/partiql/ast/Identifier$Symbol;)V - public final fun setByAlias (Lorg/partiql/ast/Identifier$Symbol;)V + 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/Binder;)V public final fun setPath (Lorg/partiql/ast/Path;)V } public final class org/partiql/ast/builder/StatementDmlInsertBuilder { public fun ()V - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;)V - public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/OnConflict;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/StatementDmlInsertBuilder; + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;)V + public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;Lorg/partiql/ast/OnConflict;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/StatementDmlInsertBuilder; public final fun build ()Lorg/partiql/ast/Statement$DML$Insert; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getOnConflict ()Lorg/partiql/ast/OnConflict; public final fun getTarget ()Lorg/partiql/ast/Identifier; public final fun getValues ()Lorg/partiql/ast/Expr; public final fun onConflict (Lorg/partiql/ast/OnConflict;)Lorg/partiql/ast/builder/StatementDmlInsertBuilder; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setOnConflict (Lorg/partiql/ast/OnConflict;)V public final fun setTarget (Lorg/partiql/ast/Identifier;)V public final fun setValues (Lorg/partiql/ast/Expr;)V @@ -5801,14 +5838,14 @@ public final class org/partiql/ast/builder/StatementDmlRemoveBuilder { public final class org/partiql/ast/builder/StatementDmlReplaceBuilder { public fun ()V - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/StatementDmlReplaceBuilder; + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/StatementDmlReplaceBuilder; public final fun build ()Lorg/partiql/ast/Statement$DML$Replace; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getTarget ()Lorg/partiql/ast/Identifier; public final fun getValues ()Lorg/partiql/ast/Expr; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setTarget (Lorg/partiql/ast/Identifier;)V public final fun setValues (Lorg/partiql/ast/Expr;)V public final fun target (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDmlReplaceBuilder; @@ -5843,14 +5880,14 @@ public final class org/partiql/ast/builder/StatementDmlUpdateBuilder { public final class org/partiql/ast/builder/StatementDmlUpsertBuilder { public fun ()V - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;)V - public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Identifier$Symbol;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun asAlias (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/StatementDmlUpsertBuilder; + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;)V + public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Binder;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun asAlias (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/StatementDmlUpsertBuilder; public final fun build ()Lorg/partiql/ast/Statement$DML$Upsert; - public final fun getAsAlias ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getAsAlias ()Lorg/partiql/ast/Binder; public final fun getTarget ()Lorg/partiql/ast/Identifier; public final fun getValues ()Lorg/partiql/ast/Expr; - public final fun setAsAlias (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setAsAlias (Lorg/partiql/ast/Binder;)V public final fun setTarget (Lorg/partiql/ast/Identifier;)V public final fun setValues (Lorg/partiql/ast/Expr;)V public final fun target (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDmlUpsertBuilder; @@ -6177,21 +6214,21 @@ public final class org/partiql/ast/builder/TypeStructBuilder { public final class org/partiql/ast/builder/TypeStructFieldBuilder { public fun ()V - public fun (Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;)V - public synthetic fun (Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;)V + public synthetic fun (Lorg/partiql/ast/Binder;Lorg/partiql/ast/Type;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun build ()Lorg/partiql/ast/Type$Struct$Field; public final fun comment (Ljava/lang/String;)Lorg/partiql/ast/builder/TypeStructFieldBuilder; public final fun constraints (Ljava/util/List;)Lorg/partiql/ast/builder/TypeStructFieldBuilder; public final fun getComment ()Ljava/lang/String; public final fun getConstraints ()Ljava/util/List; - public final fun getName ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getName ()Lorg/partiql/ast/Binder; public final fun getType ()Lorg/partiql/ast/Type; public final fun isOptional ()Ljava/lang/Boolean; public final fun isOptional (Ljava/lang/Boolean;)Lorg/partiql/ast/builder/TypeStructFieldBuilder; - public final fun name (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/TypeStructFieldBuilder; + public final fun name (Lorg/partiql/ast/Binder;)Lorg/partiql/ast/builder/TypeStructFieldBuilder; public final fun setComment (Ljava/lang/String;)V public final fun setConstraints (Ljava/util/List;)V - public final fun setName (Lorg/partiql/ast/Identifier$Symbol;)V + public final fun setName (Lorg/partiql/ast/Binder;)V public final fun setOptional (Ljava/lang/Boolean;)V public final fun setType (Lorg/partiql/ast/Type;)V public final fun type (Lorg/partiql/ast/Type;)Lorg/partiql/ast/builder/TypeStructFieldBuilder; @@ -6262,11 +6299,6 @@ public final class org/partiql/ast/builder/TypeVarcharBuilder { public final fun setLength (Ljava/lang/Integer;)V } -public final class org/partiql/ast/helpers/ToBinderKt { - public static final fun toBinder (Lorg/partiql/ast/Expr;I)Lorg/partiql/ast/Identifier$Symbol; - public static final fun toBinder (Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function0;)Lorg/partiql/ast/Identifier$Symbol; -} - public final class org/partiql/ast/helpers/ToLegacyAstKt { public static final fun toLegacyAst (Lorg/partiql/ast/AstNode;Ljava/util/Map;)Lorg/partiql/lang/domains/PartiqlAst$PartiqlAstNode; public static synthetic fun toLegacyAst$default (Lorg/partiql/ast/AstNode;Ljava/util/Map;ILjava/lang/Object;)Lorg/partiql/lang/domains/PartiqlAst$PartiqlAstNode; @@ -6276,15 +6308,6 @@ public abstract interface class org/partiql/ast/normalize/AstPass { public abstract fun apply (Lorg/partiql/ast/Statement;)Lorg/partiql/ast/Statement; } -public final class org/partiql/ast/normalize/NormalizeGroupBy : org/partiql/ast/normalize/AstPass { - public static final field INSTANCE Lorg/partiql/ast/normalize/NormalizeGroupBy; - public fun apply (Lorg/partiql/ast/Statement;)Lorg/partiql/ast/Statement; -} - -public final class org/partiql/ast/normalize/NormalizeKt { - public static final fun normalize (Lorg/partiql/ast/Statement;)Lorg/partiql/ast/Statement; -} - public abstract class org/partiql/ast/sql/BlockBaseVisitor : org/partiql/ast/sql/BlockVisitor { public fun ()V public abstract fun defaultReturn (Lorg/partiql/ast/sql/SqlBlock;Ljava/lang/Object;)Ljava/lang/Object; @@ -6612,6 +6635,8 @@ public abstract class org/partiql/ast/util/AstRewriter : org/partiql/ast/visitor public fun ()V public synthetic fun defaultReturn (Lorg/partiql/ast/AstNode;Ljava/lang/Object;)Ljava/lang/Object; public fun defaultReturn (Lorg/partiql/ast/AstNode;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitBinder (Lorg/partiql/ast/Binder;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitBinder (Lorg/partiql/ast/Binder;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitConstraint (Lorg/partiql/ast/Constraint;Ljava/lang/Object;)Ljava/lang/Object; public fun visitConstraint (Lorg/partiql/ast/Constraint;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitConstraintDefinitionCheck (Lorg/partiql/ast/Constraint$Definition$Check;Ljava/lang/Object;)Ljava/lang/Object; @@ -6953,6 +6978,7 @@ public abstract class org/partiql/ast/visitor/AstBaseVisitor : org/partiql/ast/v public abstract fun defaultReturn (Lorg/partiql/ast/AstNode;Ljava/lang/Object;)Ljava/lang/Object; public fun defaultVisit (Lorg/partiql/ast/AstNode;Ljava/lang/Object;)Ljava/lang/Object; public fun visit (Lorg/partiql/ast/AstNode;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitBinder (Lorg/partiql/ast/Binder;Ljava/lang/Object;)Ljava/lang/Object; public fun visitConstraint (Lorg/partiql/ast/Constraint;Ljava/lang/Object;)Ljava/lang/Object; public fun visitConstraintDefinition (Lorg/partiql/ast/Constraint$Definition;Ljava/lang/Object;)Ljava/lang/Object; public fun visitConstraintDefinitionCheck (Lorg/partiql/ast/Constraint$Definition$Check;Ljava/lang/Object;)Ljava/lang/Object; @@ -7146,6 +7172,7 @@ public abstract class org/partiql/ast/visitor/AstBaseVisitor : org/partiql/ast/v public abstract interface class org/partiql/ast/visitor/AstVisitor { public abstract fun visit (Lorg/partiql/ast/AstNode;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitBinder (Lorg/partiql/ast/Binder;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitConstraint (Lorg/partiql/ast/Constraint;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitConstraintDefinition (Lorg/partiql/ast/Constraint$Definition;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitConstraintDefinitionCheck (Lorg/partiql/ast/Constraint$Definition$Check;Ljava/lang/Object;)Ljava/lang/Object; diff --git a/partiql-ast/src/main/kotlin/org/partiql/ast/sql/internal/InternalSqlDialect.kt b/partiql-ast/src/main/kotlin/org/partiql/ast/sql/internal/InternalSqlDialect.kt index 6c93aa009b..e095337224 100644 --- a/partiql-ast/src/main/kotlin/org/partiql/ast/sql/internal/InternalSqlDialect.kt +++ b/partiql-ast/src/main/kotlin/org/partiql/ast/sql/internal/InternalSqlDialect.kt @@ -15,6 +15,7 @@ package org.partiql.ast.sql.internal import org.partiql.ast.AstNode +import org.partiql.ast.Binder import org.partiql.ast.Exclude import org.partiql.ast.Expr import org.partiql.ast.From @@ -29,6 +30,7 @@ import org.partiql.ast.SetQuantifier import org.partiql.ast.Sort import org.partiql.ast.Statement import org.partiql.ast.Type +import org.partiql.ast.sql.sql import org.partiql.ast.visitor.AstBaseVisitor import org.partiql.value.MissingValue import org.partiql.value.NullValue @@ -92,6 +94,8 @@ internal abstract class InternalSqlDialect : AstBaseVisitor when (step) { @@ -845,4 +849,9 @@ internal abstract class InternalSqlDialect : AstBaseVisitor "\"$symbol\"" Identifier.CaseSensitivity.INSENSITIVE -> symbol // verbatim .. } + + private fun Binder.sql() = when (isRegular) { + true -> symbol + false -> "\"$symbol\"" + } } diff --git a/partiql-ast/src/main/resources/partiql_ast.ion b/partiql-ast/src/main/resources/partiql_ast.ion index a7b32727fd..070b8cd49e 100644 --- a/partiql-ast/src/main/resources/partiql_ast.ion +++ b/partiql-ast/src/main/resources/partiql_ast.ion @@ -18,7 +18,7 @@ statement::[ insert::{ target: identifier, values: expr, - as_alias: optional::'.identifier.symbol', + as_alias: optional::binder, on_conflict: optional::on_conflict, }, @@ -34,14 +34,14 @@ statement::[ upsert::{ target: identifier, values: expr, - as_alias: optional::'.identifier.symbol', + as_alias: optional::binder, }, // REPLACE INTO [AS ] replace::{ target: identifier, values: expr, - as_alias: optional::'.identifier.symbol', + as_alias: optional::binder, }, // UPDATE SET WHERE @@ -65,9 +65,9 @@ statement::[ delete::{ target: { path: path, - as_alias: optional::'.identifier.symbol', - at_alias: optional::'.identifier.symbol', - by_alias: optional::'.identifier.symbol', + as_alias: optional::binder, + at_alias: optional::binder, + by_alias: optional::binder, }, where: optional::expr, returning: optional::returning, @@ -84,7 +84,7 @@ statement::[ insert::{ target: identifier, values: expr, - as_alias: optional::'.identifier.symbol', + as_alias: optional::binder, on_conflict: optional::on_conflict, }, insert_legacy::{ @@ -233,7 +233,7 @@ type::[ fields: list::[field], _ : [ field :: { - name: '.identifier.symbol', + name: binder, type: '.type', // This could be a boolean flag since we only support NOT NULL constraint // for struct subfield. But modeling this to be a list of constraints @@ -274,6 +274,14 @@ identifier::[ ], ] +// identifier for lvalue +// binder can not be qualified. +// it exists for eaiser visitor implementation and maintainence +binder::{ + symbol: string, + is_regular: bool +} + // Path Literals // - Much like qualified identifier but allowing bracket notation '[' | ']' // - Not a variant of `identifier`, as path literals are not explicit in the specification. @@ -585,7 +593,7 @@ select::[ _: [ item::[ all::{ expr: expr }, // .* - expression::{ expr: expr, as_alias: optional::'.identifier.symbol' } // [as ] + expression::{ expr: expr, as_alias: optional::binder } // [as ] ], ], }, @@ -626,9 +634,9 @@ from::[ value::{ expr: expr, type: [ SCAN, UNPIVOT ], - as_alias: optional::'.identifier.symbol', - at_alias: optional::'.identifier.symbol', - by_alias: optional::'.identifier.symbol', + as_alias: optional::binder, + at_alias: optional::binder, + by_alias: optional::binder, }, // TODO https://github.com/partiql/partiql-spec/issues/41 @@ -656,7 +664,7 @@ let::{ _: [ binding::{ expr: expr, - as_alias: '.identifier.symbol', + as_alias: binder, }, ], } @@ -665,11 +673,11 @@ let::{ group_by::{ strategy: [ FULL, PARTIAL ], keys: list::[key], - as_alias: optional::'.identifier.symbol', + as_alias: optional::binder, _: [ key::{ expr: expr, - as_alias: optional::'.identifier.symbol', + as_alias: optional::binder, }, ], } 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 440b9911d4..d54fb42e6b 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 @@ -24,6 +24,7 @@ import org.partiql.ast.GroupBy import org.partiql.ast.Identifier import org.partiql.ast.SetQuantifier import org.partiql.ast.Sort +import org.partiql.ast.binder import org.partiql.ast.builder.AstBuilder import org.partiql.ast.builder.ast import org.partiql.ast.exprLit @@ -128,6 +129,8 @@ class ToLegacyAstTest { // Shortcut to construct a "legacy-compatible" simple identifier private fun id(name: String) = identifierSymbol(name, Identifier.CaseSensitivity.INSENSITIVE) + private fun bindName(name: String) = binder(name, true) + @JvmStatic fun literals() = listOf( expect("(lit null)") { @@ -422,7 +425,7 @@ class ToLegacyAstTest { fail("The legacy AST does not support field declaration in struct type") { typeStruct { fields += org.partiql.ast.typeStructField( - org.partiql.ast.identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), + org.partiql.ast.binder("a", true), typeInt2(), emptyList(), false, @@ -549,7 +552,7 @@ class ToLegacyAstTest { } items += selectProjectItemExpression { expr = exprLit(int32Value(1)) - asAlias = id("x") + asAlias = bindName("x") } } }, @@ -579,9 +582,9 @@ class ToLegacyAstTest { fromValue { expr = NULL type = From.Value.Type.SCAN - asAlias = id("a") - atAlias = id("b") - byAlias = id("c") + asAlias = bindName("a") + atAlias = bindName("b") + byAlias = bindName("c") } }, expect("(unpivot (lit null) null null null)") { @@ -594,9 +597,9 @@ class ToLegacyAstTest { fromValue { expr = NULL type = From.Value.Type.UNPIVOT - asAlias = id("a") - atAlias = id("b") - byAlias = id("c") + asAlias = bindName("a") + atAlias = bindName("b") + byAlias = bindName("c") } }, expect( @@ -647,7 +650,7 @@ class ToLegacyAstTest { let { bindings += letBinding { expr = NULL - asAlias = id("x") + asAlias = bindName("x") } } }, @@ -665,7 +668,7 @@ class ToLegacyAstTest { groupBy { strategy = GroupBy.Strategy.FULL keys += groupByKey(exprLit(stringValue("a")), null) - keys += groupByKey(exprLit(stringValue("b")), id("x")) + keys += groupByKey(exprLit(stringValue("b")), bindName("x")) } }, expect( @@ -682,8 +685,8 @@ class ToLegacyAstTest { groupBy { strategy = GroupBy.Strategy.PARTIAL keys += groupByKey(exprLit(stringValue("a")), null) - keys += groupByKey(exprLit(stringValue("b")), id("x")) - asAlias = id("as") + keys += groupByKey(exprLit(stringValue("b")), bindName("x")) + asAlias = bindName("as") } }, 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 e93e1294f8..acea03a703 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 @@ -1010,7 +1010,7 @@ class SqlDialectTest { expect("SELECT a AS x FROM T") { exprSFW { select = selectProject { - items += selectProjectItemExpression(v("a"), id("x")) + items += selectProjectItemExpression(v("a"), bindName("x")) } from = table("T") } @@ -1018,8 +1018,8 @@ class SqlDialectTest { expect("SELECT a AS x, b AS y FROM T") { exprSFW { select = selectProject { - items += selectProjectItemExpression(v("a"), id("x")) - items += selectProjectItemExpression(v("b"), id("y")) + items += selectProjectItemExpression(v("a"), bindName("x")) + items += selectProjectItemExpression(v("b"), bindName("y")) } from = table("T") } @@ -1205,7 +1205,7 @@ class SqlDialectTest { from = fromValue { expr = v("T") type = From.Value.Type.SCAN - asAlias = id("x") + asAlias = bindName("x") } } }, @@ -1215,8 +1215,8 @@ class SqlDialectTest { from = fromValue { expr = v("T") type = From.Value.Type.SCAN - asAlias = id("x") - atAlias = id("y") + asAlias = bindName("x") + atAlias = bindName("y") } } }, @@ -1226,9 +1226,9 @@ class SqlDialectTest { from = fromValue { expr = v("T") type = From.Value.Type.SCAN - asAlias = id("x") - atAlias = id("y") - byAlias = id("z") + asAlias = bindName("x") + atAlias = bindName("y") + byAlias = bindName("z") } } }, @@ -1247,7 +1247,7 @@ class SqlDialectTest { from = fromValue { expr = v("T") type = From.Value.Type.UNPIVOT - asAlias = id("x") + asAlias = bindName("x") } } }, @@ -1257,8 +1257,8 @@ class SqlDialectTest { from = fromValue { expr = v("T") type = From.Value.Type.UNPIVOT - asAlias = id("x") - atAlias = id("y") + asAlias = bindName("x") + atAlias = bindName("y") } } }, @@ -1268,9 +1268,9 @@ class SqlDialectTest { from = fromValue { expr = v("T") type = From.Value.Type.UNPIVOT - asAlias = id("x") - atAlias = id("y") - byAlias = id("z") + asAlias = bindName("x") + atAlias = bindName("y") + byAlias = bindName("z") } } }, @@ -1348,7 +1348,7 @@ class SqlDialectTest { select = select("a") from = table("T") let = let(mutableListOf()) { - bindings += letBinding(v("x"), id("i")) + bindings += letBinding(v("x"), bindName("i")) } } }, @@ -1357,8 +1357,8 @@ class SqlDialectTest { select = select("a") from = table("T") let = let(mutableListOf()) { - bindings += letBinding(v("x"), id("i")) - bindings += letBinding(v("y"), id("j")) + bindings += letBinding(v("x"), bindName("i")) + bindings += letBinding(v("y"), bindName("j")) } } }, @@ -1422,7 +1422,7 @@ class SqlDialectTest { from = table("T") groupBy = groupBy { strategy = GroupBy.Strategy.FULL - keys += groupByKey(v("x"), id("i")) + keys += groupByKey(v("x"), bindName("i")) } } }, @@ -1443,8 +1443,8 @@ class SqlDialectTest { from = table("T") groupBy = groupBy { strategy = GroupBy.Strategy.FULL - keys += groupByKey(v("x"), id("i")) - keys += groupByKey(v("y"), id("j")) + keys += groupByKey(v("x"), bindName("i")) + keys += groupByKey(v("y"), bindName("j")) } } }, @@ -1455,7 +1455,7 @@ class SqlDialectTest { groupBy = groupBy { strategy = GroupBy.Strategy.FULL keys += groupByKey(v("x")) - asAlias = id("g") + asAlias = bindName("g") } } }, @@ -1465,8 +1465,8 @@ class SqlDialectTest { from = table("T") groupBy = groupBy { strategy = GroupBy.Strategy.FULL - keys += groupByKey(v("x"), id("i")) - asAlias = id("g") + keys += groupByKey(v("x"), bindName("i")) + asAlias = bindName("g") } } }, @@ -1478,7 +1478,7 @@ class SqlDialectTest { strategy = GroupBy.Strategy.FULL keys += groupByKey(v("x")) keys += groupByKey(v("y")) - asAlias = id("g") + asAlias = bindName("g") } } }, @@ -1488,9 +1488,9 @@ class SqlDialectTest { from = table("T") groupBy = groupBy { strategy = GroupBy.Strategy.FULL - keys += groupByKey(v("x"), id("i")) - keys += groupByKey(v("y"), id("j")) - asAlias = id("g") + keys += groupByKey(v("x"), bindName("i")) + keys += groupByKey(v("y"), bindName("j")) + asAlias = bindName("g") } } }, @@ -1785,6 +1785,11 @@ class SqlDialectTest { case: Identifier.CaseSensitivity = Identifier.CaseSensitivity.INSENSITIVE, ) = this.identifierSymbol(symbol, case) + private fun AstBuilder.bindName( + symbol: String, + isRegular: Boolean = true + ) = this.binder(symbol, isRegular) + private fun AstBuilder.select(vararg s: String) = selectProject { s.forEach { items += selectProjectItemExpression(v(it)) 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 19bdef2d9e..9ac22ede6e 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 @@ -33,6 +33,7 @@ import org.antlr.v4.runtime.atn.PredictionMode import org.antlr.v4.runtime.misc.ParseCancellationException import org.antlr.v4.runtime.tree.TerminalNode import org.partiql.ast.AstNode +import org.partiql.ast.Binder import org.partiql.ast.Constraint import org.partiql.ast.DatetimeField import org.partiql.ast.DdlOp @@ -53,6 +54,7 @@ import org.partiql.ast.SetQuantifier import org.partiql.ast.Sort import org.partiql.ast.Statement import org.partiql.ast.Type +import org.partiql.ast.binder import org.partiql.ast.constraint import org.partiql.ast.constraintDefinitionCheck import org.partiql.ast.constraintDefinitionNotNull @@ -569,6 +571,11 @@ internal class PartiQLParserDefault : PartiQLParser { else -> throw error(ctx, "Invalid symbol reference.") } + private fun Identifier.Symbol.asBinder() = when (this.caseSensitivity) { + Identifier.CaseSensitivity.SENSITIVE -> binder(this.symbol, false) + Identifier.CaseSensitivity.INSENSITIVE -> binder(this.symbol, true) + } + override fun visitIdentifierQuoted(ctx: GeneratedParser.IdentifierQuotedContext): Identifier.Symbol = translate(ctx) { identifierSymbol( ctx.IDENTIFIER_QUOTED().getStringValue(), @@ -875,7 +882,7 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitInsertStatement(ctx: GeneratedParser.InsertStatementContext) = translate(ctx) { val target = visitSymbolPrimitive(ctx.symbolPrimitive()) val values = visitExpr(ctx.value) - val asAlias = visitOrNull(ctx.asIdent()) + val asAlias = visitOrNull(ctx.asIdent())?.asBinder() val onConflict = ctx.onConflict()?.let { visitOnConflictClause(it) } statementDMLInsert(target, values, asAlias, onConflict) } @@ -883,14 +890,14 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitReplaceCommand(ctx: GeneratedParser.ReplaceCommandContext) = translate(ctx) { val target = visitSymbolPrimitive(ctx.symbolPrimitive()) val values = visitExpr(ctx.value) - val asAlias = visitOrNull(ctx.asIdent()) + val asAlias = visitOrNull(ctx.asIdent())?.asBinder() statementDMLReplace(target, values, asAlias) } override fun visitUpsertCommand(ctx: GeneratedParser.UpsertCommandContext) = translate(ctx) { val target = visitSymbolPrimitive(ctx.symbolPrimitive()) val values = visitExpr(ctx.value) - val asAlias = visitOrNull(ctx.asIdent()) + val asAlias = visitOrNull(ctx.asIdent())?.asBinder() statementDMLUpsert(target, values, asAlias) } @@ -1069,7 +1076,7 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitProjectionItem(ctx: GeneratedParser.ProjectionItemContext) = translate(ctx) { val expr = visitExpr(ctx.expr()) - val alias = ctx.symbolPrimitive()?.let { visitSymbolPrimitive(it) } + val alias = ctx.symbolPrimitive()?.let { visitSymbolPrimitive(it).asBinder() } if (expr is Expr.Path) { convertPathToProjectionItem(ctx, expr, alias) } else { @@ -1113,7 +1120,7 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitLetBinding(ctx: GeneratedParser.LetBindingContext) = translate(ctx) { val expr = visitAs(ctx.expr()) - val alias = visitSymbolPrimitive(ctx.symbolPrimitive()) + val alias = visitSymbolPrimitive(ctx.symbolPrimitive()).asBinder() letBinding(expr, alias) } @@ -1154,13 +1161,13 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitGroupClause(ctx: GeneratedParser.GroupClauseContext) = translate(ctx) { val strategy = if (ctx.PARTIAL() != null) GroupBy.Strategy.PARTIAL else GroupBy.Strategy.FULL val keys = visitOrEmpty(ctx.groupKey()) - val alias = ctx.groupAlias()?.symbolPrimitive()?.let { visitSymbolPrimitive(it) } + val alias = ctx.groupAlias()?.symbolPrimitive()?.let { visitSymbolPrimitive(it).asBinder() } groupBy(strategy, keys, alias) } override fun visitGroupKey(ctx: GeneratedParser.GroupKeyContext) = translate(ctx) { val expr = visitAs(ctx.key) - val alias = ctx.symbolPrimitive()?.let { visitSymbolPrimitive(it) } + val alias = ctx.symbolPrimitive()?.let { visitSymbolPrimitive(it).asBinder() } groupByKey(expr, alias) } @@ -1463,17 +1470,17 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitTableBaseRefClauses(ctx: GeneratedParser.TableBaseRefClausesContext) = translate(ctx) { val expr = visitAs(ctx.source) - val asAlias = ctx.asIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } - val atAlias = ctx.atIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } - val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } + 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()).asBinder() } fromValue(expr, From.Value.Type.SCAN, asAlias, atAlias, byAlias) } override fun visitTableBaseRefMatch(ctx: GeneratedParser.TableBaseRefMatchContext) = translate(ctx) { val expr = visitAs(ctx.source) - val asAlias = ctx.asIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } - val atAlias = ctx.atIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } - val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } + 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()).asBinder() } fromValue(expr, From.Value.Type.SCAN, asAlias, atAlias, byAlias) } @@ -1483,9 +1490,9 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitFromClauseSimpleExplicit(ctx: GeneratedParser.FromClauseSimpleExplicitContext) = translate(ctx) { val path = visitPathSimple(ctx.pathSimple()) - val asAlias = ctx.asIdent()?.let { visitAsIdent(it) } - val atAlias = ctx.atIdent()?.let { visitAtIdent(it) } - val byAlias = ctx.byIdent()?.let { visitByIdent(it) } + val asAlias = ctx.asIdent()?.let { visitAsIdent(it).asBinder() } + val atAlias = ctx.atIdent()?.let { visitAtIdent(it).asBinder() } + val byAlias = ctx.byIdent()?.let { visitByIdent(it).asBinder() } statementDMLDeleteTarget(path, asAlias, atAlias, byAlias) } @@ -1495,15 +1502,15 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitFromClauseSimpleImplicit(ctx: GeneratedParser.FromClauseSimpleImplicitContext) = translate(ctx) { val path = visitPathSimple(ctx.pathSimple()) - val asAlias = visitSymbolPrimitive(ctx.symbolPrimitive()) + val asAlias = visitSymbolPrimitive(ctx.symbolPrimitive()).asBinder() statementDMLDeleteTarget(path, asAlias, null, null) } override fun visitTableUnpivot(ctx: GeneratedParser.TableUnpivotContext) = translate(ctx) { val expr = visitAs(ctx.expr()) - val asAlias = ctx.asIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } - val atAlias = ctx.atIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } - val byAlias = ctx.byIdent()?.let { visitSymbolPrimitive(it.symbolPrimitive()) } + 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()).asBinder() } fromValue(expr, From.Value.Type.UNPIVOT, asAlias, atAlias, byAlias) } @@ -1549,7 +1556,7 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitTableBaseRefSymbol(ctx: GeneratedParser.TableBaseRefSymbolContext) = translate(ctx) { val expr = visitAs(ctx.source) - val asAlias = visitSymbolPrimitive(ctx.symbolPrimitive()) + val asAlias = visitSymbolPrimitive(ctx.symbolPrimitive()).asBinder() fromValue(expr, From.Value.Type.SCAN, asAlias, null, null) } @@ -2258,7 +2265,7 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitTypeStruct(ctx: GeneratedParser.TypeStructContext) = translate(ctx) { val fields = ctx.structField().map { structFieldCtx -> - val name = visitSymbolPrimitive(structFieldCtx.columnName().symbolPrimitive()) + val name = visitSymbolPrimitive(structFieldCtx.columnName().symbolPrimitive()).asBinder() val type = visitAs(structFieldCtx.type()) .also { isValidTypeDeclarationOrThrow(it, structFieldCtx.type()) } @@ -2367,7 +2374,7 @@ internal class PartiQLParserDefault : PartiQLParser { * SELECT foo.*.bar FROM foo * ``` */ - protected fun convertPathToProjectionItem(ctx: ParserRuleContext, path: Expr.Path, alias: Identifier.Symbol?) = + protected fun convertPathToProjectionItem(ctx: ParserRuleContext, path: Expr.Path, alias: Binder?) = translate(ctx) { val steps = mutableListOf() var containsIndex = false diff --git a/partiql-parser/src/test/kotlin/org/partiql/parser/internal/PartiQLParserDDLTests.kt b/partiql-parser/src/test/kotlin/org/partiql/parser/internal/PartiQLParserDDLTests.kt index 7eea0be96a..bab101b086 100644 --- a/partiql-parser/src/test/kotlin/org/partiql/parser/internal/PartiQLParserDDLTests.kt +++ b/partiql-parser/src/test/kotlin/org/partiql/parser/internal/PartiQLParserDDLTests.kt @@ -12,6 +12,7 @@ import org.partiql.ast.Expr import org.partiql.ast.Identifier import org.partiql.ast.PartitionBy import org.partiql.ast.Type +import org.partiql.ast.binder import org.partiql.ast.constraint import org.partiql.ast.constraintDefinitionCheck import org.partiql.ast.constraintDefinitionNotNull @@ -370,14 +371,14 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Int2(), emptyList(), false, null ), Type.Struct.Field( - identifierSymbol("c", Identifier.CaseSensitivity.INSENSITIVE), + binder("c", true), Type.Int2(), listOf(Constraint(null, Constraint.Definition.NotNull())), false, @@ -416,11 +417,11 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("c", Identifier.CaseSensitivity.INSENSITIVE), + binder("c", true), Type.Int2(), emptyList(), false, @@ -433,7 +434,7 @@ class PartiQLParserDDLTests { null ), Type.Struct.Field( - identifierSymbol("d", Identifier.CaseSensitivity.INSENSITIVE), + binder("d", true), Type.Array(Type.Int2()), emptyList(), false, @@ -523,7 +524,7 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Int2(), emptyList(), false, @@ -560,7 +561,7 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Int2(), emptyList(), false, @@ -652,7 +653,7 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Int2(), emptyList(), true, @@ -688,7 +689,7 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Int2(), emptyList(), true, @@ -751,7 +752,7 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Int2(), emptyList(), false, @@ -787,7 +788,7 @@ class PartiQLParserDDLTests { Type.Struct( listOf( Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), + binder("b", true), Type.Int2(), emptyList(), false, diff --git a/partiql-planner/api/partiql-planner.api b/partiql-planner/api/partiql-planner.api index 75589ccc4f..1ec88bdb55 100644 --- a/partiql-planner/api/partiql-planner.api +++ b/partiql-planner/api/partiql-planner.api @@ -37,6 +37,7 @@ public final class org/partiql/planner/PartiQLPlannerBuilder { public final fun addPass (Lorg/partiql/planner/PartiQLPlannerPass;)Lorg/partiql/planner/PartiQLPlannerBuilder; public final fun addPasses ([Lorg/partiql/planner/PartiQLPlannerPass;)Lorg/partiql/planner/PartiQLPlannerBuilder; public final fun build ()Lorg/partiql/planner/PartiQLPlanner; + public final fun caseNormalize (Ljava/lang/String;)Lorg/partiql/planner/PartiQLPlannerBuilder; public final fun catalogs ([Lkotlin/Pair;)Lorg/partiql/planner/PartiQLPlannerBuilder; public final fun passes (Ljava/util/List;)Lorg/partiql/planner/PartiQLPlannerBuilder; public final fun signalMode ()Lorg/partiql/planner/PartiQLPlannerBuilder; @@ -46,3 +47,7 @@ public abstract interface class org/partiql/planner/PartiQLPlannerPass { public abstract fun apply (Lorg/partiql/plan/PartiQLPlan;Lkotlin/jvm/functions/Function1;)Lorg/partiql/plan/PartiQLPlan; } +public final class org/partiql/planner/internal/utils/ToBinderKt { + public static final fun toBinder (Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function0;)Lorg/partiql/ast/Binder; +} + diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlanner.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlanner.kt index 9e5b729307..e3cefc4dc7 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlanner.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlanner.kt @@ -56,6 +56,8 @@ public interface PartiQLPlanner { public fun builder(): PartiQLPlannerBuilder = PartiQLPlannerBuilder() @JvmStatic - public fun default(): PartiQLPlanner = PartiQLPlannerBuilder().build() + public fun default(): PartiQLPlanner = + PartiQLPlannerBuilder() + .build() } } diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlannerBuilder.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlannerBuilder.kt index 7af3c275fc..428b5c767b 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlannerBuilder.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlannerBuilder.kt @@ -1,5 +1,7 @@ package org.partiql.planner +import org.partiql.planner.internal.BooleanFlag +import org.partiql.planner.internal.CaseNormalization import org.partiql.planner.internal.PartiQLPlannerDefault import org.partiql.planner.internal.PlannerFlag import org.partiql.spi.connector.ConnectorMetadata @@ -50,7 +52,19 @@ public class PartiQLPlannerBuilder { * Java style method for setting the planner to signal mode */ public fun signalMode(): PartiQLPlannerBuilder = this.apply { - this.flags.add(PlannerFlag.SIGNAL_MODE) + this.flags.add(BooleanFlag.SIGNAL_MODE) + } + + public fun caseNormalize(behavior: String): PartiQLPlannerBuilder = this.apply { + this.flags.removeAll( + this.flags.filterIsInstance().toSet() + ) + when (behavior.uppercase()) { + CaseNormalization.UPPERCASE.name -> this.flags.add(CaseNormalization.UPPERCASE) + CaseNormalization.LOWERCASE.name -> this.flags.add(CaseNormalization.LOWERCASE) + CaseNormalization.EXACTCASE.name -> this.flags.add(CaseNormalization.EXACTCASE) + else -> error("Illegal flag, expect one of ${CaseNormalization.values()}") + } } /** diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/IdentifierManager.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/IdentifierManager.kt new file mode 100644 index 0000000000..183d5fd859 --- /dev/null +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/IdentifierManager.kt @@ -0,0 +1,37 @@ +package org.partiql.planner.internal + +import org.partiql.ast.Binder +import org.partiql.ast.Identifier +import org.partiql.ast.binder +import org.partiql.ast.identifierSymbol + +// The identifier manager class takes in two parameters, +// in case we want to decouple case preservation and case normalization behavior in the future. +internal class IdentifierManager( + private val casePreservation: CaseNormalization?, + private val caseNormalization: CaseNormalization? +) { + fun normalizeBinder(binder: Binder): Binder = + when (binder.isRegular) { + true -> { + when (casePreservation) { + CaseNormalization.UPPERCASE -> binder(binder.symbol.uppercase(), false) + CaseNormalization.LOWERCASE -> binder(binder.symbol.lowercase(), false) + CaseNormalization.EXACTCASE -> binder(binder.symbol, false) + null -> binder(binder.symbol, false) + } + } + false -> binder + } + + fun normalizeRvalue(id: Identifier.Symbol): Identifier.Symbol = + when (id.caseSensitivity) { + Identifier.CaseSensitivity.SENSITIVE -> id + Identifier.CaseSensitivity.INSENSITIVE -> when (caseNormalization) { + CaseNormalization.UPPERCASE -> identifierSymbol(id.symbol.uppercase(), Identifier.CaseSensitivity.SENSITIVE) + CaseNormalization.LOWERCASE -> identifierSymbol(id.symbol.lowercase(), Identifier.CaseSensitivity.SENSITIVE) + CaseNormalization.EXACTCASE -> identifierSymbol(id.symbol, Identifier.CaseSensitivity.SENSITIVE) + null -> id + } + } +} diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PartiQLPlannerDefault.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PartiQLPlannerDefault.kt index a9815a8bdb..515fd056e9 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PartiQLPlannerDefault.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PartiQLPlannerDefault.kt @@ -1,10 +1,10 @@ package org.partiql.planner.internal import org.partiql.ast.Statement -import org.partiql.ast.normalize.normalize import org.partiql.errors.ProblemCallback import org.partiql.planner.PartiQLPlanner import org.partiql.planner.PartiQLPlannerPass +import org.partiql.planner.internal.astPasses.normalize import org.partiql.planner.internal.transforms.AstToPlan import org.partiql.planner.internal.transforms.PlanTransform import org.partiql.planner.internal.typer.PlanTyper @@ -27,7 +27,7 @@ internal class PartiQLPlannerDefault( val env = Env(session) // 1. Normalize - val ast = statement.normalize() + val ast = statement.normalize(flags) // 2. AST to Rel/Rex val root = AstToPlan.apply(ast, env) diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PlannerFlag.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PlannerFlag.kt index bd91be0535..8b7bfafa0f 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PlannerFlag.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/PlannerFlag.kt @@ -1,6 +1,9 @@ package org.partiql.planner.internal -internal enum class PlannerFlag { +// Marker interface +internal interface PlannerFlag + +internal enum class BooleanFlag : PlannerFlag { /** * Determine the planner behavior upon encounter an operation that always returns MISSING. * @@ -16,5 +19,22 @@ internal enum class PlannerFlag { * * The result plan will turn the problematic operation into a missing node. */ - SIGNAL_MODE + SIGNAL_MODE, +} + +internal enum class CaseNormalization : PlannerFlag { + /** + * Normalize identifier using uppercase (SQL Spec) + */ + UPPERCASE, + + /** + * Normalize identifier using lowercase (Postgres and friends) + */ + LOWERCASE, + + /** + * Normalize identifier by preserving original text (N1QL and friends) + */ + EXACTCASE, } diff --git a/partiql-ast/src/main/kotlin/org/partiql/ast/normalize/Normalize.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/Normalize.kt similarity index 67% rename from partiql-ast/src/main/kotlin/org/partiql/ast/normalize/Normalize.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/Normalize.kt index 5ed50112f2..ad953ac434 100644 --- a/partiql-ast/src/main/kotlin/org/partiql/ast/normalize/Normalize.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/Normalize.kt @@ -12,16 +12,21 @@ * language governing permissions and limitations under the License. */ -package org.partiql.ast.normalize +package org.partiql.planner.internal.astPasses import org.partiql.ast.Statement +import org.partiql.planner.internal.CaseNormalization +import org.partiql.planner.internal.PlannerFlag /** * AST normalization */ -public fun Statement.normalize(): Statement { +internal fun Statement.normalize(flags: Set): Statement { // could be a fold, but this is nice for setting breakpoints var ast = this + val caseNormalization = flags.firstOrNull { it is CaseNormalization } as? CaseNormalization + // Order matters here! + ast = NormalizeIdentifier(caseNormalization).apply(ast) ast = NormalizeFromSource.apply(ast) ast = NormalizeGroupBy.apply(ast) return ast diff --git a/partiql-ast/src/main/kotlin/org/partiql/ast/normalize/NormalizeFromSource.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeFromSource.kt similarity index 95% rename from partiql-ast/src/main/kotlin/org/partiql/ast/normalize/NormalizeFromSource.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeFromSource.kt index 8c12807ef6..81e44cbbc9 100644 --- a/partiql-ast/src/main/kotlin/org/partiql/ast/normalize/NormalizeFromSource.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeFromSource.kt @@ -12,15 +12,16 @@ * language governing permissions and limitations under the License. */ -package org.partiql.ast.normalize +package org.partiql.planner.internal.astPasses import org.partiql.ast.AstNode import org.partiql.ast.Expr import org.partiql.ast.From import org.partiql.ast.Statement import org.partiql.ast.fromJoin -import org.partiql.ast.helpers.toBinder +import org.partiql.ast.normalize.AstPass import org.partiql.ast.util.AstRewriter +import org.partiql.planner.internal.utils.toBinder /** * Assign aliases to any FROM source which does not have one. diff --git a/partiql-ast/src/main/kotlin/org/partiql/ast/normalize/NormalizeGroupBy.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeGroupBy.kt similarity index 90% rename from partiql-ast/src/main/kotlin/org/partiql/ast/normalize/NormalizeGroupBy.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeGroupBy.kt index ccc2c9d1f4..b2c21d5d42 100644 --- a/partiql-ast/src/main/kotlin/org/partiql/ast/normalize/NormalizeGroupBy.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeGroupBy.kt @@ -12,20 +12,21 @@ * language governing permissions and limitations under the License. */ -package org.partiql.ast.normalize +package org.partiql.planner.internal.astPasses import org.partiql.ast.AstNode import org.partiql.ast.Expr import org.partiql.ast.GroupBy import org.partiql.ast.Statement import org.partiql.ast.groupByKey -import org.partiql.ast.helpers.toBinder +import org.partiql.ast.normalize.AstPass import org.partiql.ast.util.AstRewriter +import org.partiql.planner.internal.utils.toBinder /** * Adds a unique binder to each group key. */ -object NormalizeGroupBy : AstPass { +internal object NormalizeGroupBy : AstPass { override fun apply(statement: Statement) = Visitor.visitStatement(statement, 0) as Statement diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeIdentifier.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeIdentifier.kt new file mode 100644 index 0000000000..92b21392c4 --- /dev/null +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeIdentifier.kt @@ -0,0 +1,32 @@ +package org.partiql.planner.internal.astPasses + +import org.partiql.ast.Binder +import org.partiql.ast.Identifier +import org.partiql.ast.Statement +import org.partiql.ast.normalize.AstPass +import org.partiql.ast.util.AstRewriter +import org.partiql.planner.internal.CaseNormalization +import org.partiql.planner.internal.IdentifierManager + +/** + * Case Normalization behavior: + * - UPPERCASE: normalize identifier using uppercase for both lvalue and rvalue + * - LOWERCASE: normalize identifier using lowercase for both lvalue and rvalue + * - EXACTCASE: normalize identifier by preserving case for both lvalue and rvalue + * - NULL: Normalize lvalue by preserving case, no normalization for rvalue. + */ +internal class NormalizeIdentifier( + caseNormalization: CaseNormalization? +) : AstPass { + + val identifierManager = IdentifierManager(caseNormalization, caseNormalization) + override fun apply(statement: Statement): Statement = Visitor(identifierManager).visitStatement(statement, Unit) as Statement + + private class Visitor(val identifierManager: IdentifierManager) : AstRewriter() { + + override fun visitIdentifierSymbol(node: Identifier.Symbol, ctx: Unit) = + identifierManager.normalizeRvalue(node) + + override fun visitBinder(node: Binder, ctx: Unit) = identifierManager.normalizeBinder(node) + } +} diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/NormalizeSelect.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeSelect.kt similarity index 93% rename from partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/NormalizeSelect.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeSelect.kt index cd2649dd64..fc16a3dbf5 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/NormalizeSelect.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/astPasses/NormalizeSelect.kt @@ -12,13 +12,14 @@ * language governing permissions and limitations under the License. */ -package org.partiql.planner.internal.transforms +package org.partiql.planner.internal.astPasses import org.partiql.ast.Expr import org.partiql.ast.From import org.partiql.ast.GroupBy import org.partiql.ast.Identifier import org.partiql.ast.Select +import org.partiql.ast.binder import org.partiql.ast.exprCall import org.partiql.ast.exprCase import org.partiql.ast.exprCaseBranch @@ -27,13 +28,13 @@ import org.partiql.ast.exprLit import org.partiql.ast.exprStruct import org.partiql.ast.exprStructField import org.partiql.ast.exprVar -import org.partiql.ast.helpers.toBinder import org.partiql.ast.identifierSymbol import org.partiql.ast.selectProject import org.partiql.ast.selectProjectItemExpression import org.partiql.ast.selectValue import org.partiql.ast.typeStruct import org.partiql.ast.util.AstRewriter +import org.partiql.planner.internal.utils.toBinder import org.partiql.value.PartiQLValueExperimental import org.partiql.value.stringValue @@ -93,7 +94,7 @@ import org.partiql.value.stringValue * } FROM R AS "R" * ``` * - * Requires [NormalizeFromSource]. + * Requires [NormalizeFromSource] and [NormalizeIdentifier]. */ internal object NormalizeSelect { @@ -333,10 +334,21 @@ internal object NormalizeSelect { // t -> t AS t private fun String.simple(): Select.Project.Item.Expression { val expr = exprVar(id(this), Expr.Var.Scope.DEFAULT) - val alias = id(this) + val alias = binder(this) return selectProjectItemExpression(expr, alias) } private fun id(symbol: String) = identifierSymbol(symbol, Identifier.CaseSensitivity.INSENSITIVE) + + // The normalize select pass today is invoked during toPlan Conversion + // We normalize Identifier before this pass is invoked: + // When this pass invokes, we need to create delimited binding + // For example: + // SELECT bAr ... + // Upper -> SELECT "BAR" -> SELECT VALUE {'BAR': "BAR"} + // LOWER -> SELECT "bar" -> SELECT VALUE ('bar' : "bar"} + // EXACT -> SELECT "bAr" -> SELECT VALUE ('bAr' : "bAR"} + // null -> SELECT bAr -> SELECT VALUE {'bAr' : bAr} + private fun binder(symbol: String) = binder(symbol, false) } } diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt index 0d0c7de206..196b0ee785 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/PlanTransform.kt @@ -5,6 +5,7 @@ import org.partiql.plan.PlanNode import org.partiql.plan.partiQLPlan import org.partiql.plan.rexOpCast import org.partiql.plan.rexOpErr +import org.partiql.planner.internal.BooleanFlag import org.partiql.planner.internal.PlannerFlag import org.partiql.planner.internal.ProblemGenerator import org.partiql.planner.internal.ir.Identifier @@ -27,7 +28,7 @@ import org.partiql.value.PartiQLValueExperimental internal class PlanTransform( flags: Set ) { - private val signalMode = flags.contains(PlannerFlag.SIGNAL_MODE) + private val signalMode = flags.contains(BooleanFlag.SIGNAL_MODE) fun transform(node: PartiQLPlan, onProblem: ProblemCallback): org.partiql.plan.PartiQLPlan { val symbols = Symbols.empty() diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RelConverter.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RelConverter.kt index c1c62bb092..b16c0944e1 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RelConverter.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RelConverter.kt @@ -30,11 +30,11 @@ import org.partiql.ast.Sort import org.partiql.ast.builder.ast import org.partiql.ast.exprLit import org.partiql.ast.exprVar -import org.partiql.ast.helpers.toBinder import org.partiql.ast.identifierSymbol import org.partiql.ast.util.AstRewriter import org.partiql.ast.visitor.AstBaseVisitor import org.partiql.planner.internal.Env +import org.partiql.planner.internal.astPasses.NormalizeSelect import org.partiql.planner.internal.ir.Rel import org.partiql.planner.internal.ir.Rex import org.partiql.planner.internal.ir.rel @@ -70,6 +70,7 @@ import org.partiql.planner.internal.ir.rexOpStruct import org.partiql.planner.internal.ir.rexOpStructField import org.partiql.planner.internal.ir.rexOpVarLocal import org.partiql.planner.internal.typer.CompilerType +import org.partiql.planner.internal.utils.toBinder import org.partiql.types.PType import org.partiql.value.PartiQLValueExperimental import org.partiql.value.boolValue diff --git a/partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToBinder.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/utils/ToBinder.kt similarity index 65% rename from partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToBinder.kt rename to partiql-planner/src/main/kotlin/org/partiql/planner/internal/utils/ToBinder.kt index d0bd97ca12..29787316d6 100644 --- a/partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToBinder.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/utils/ToBinder.kt @@ -1,5 +1,6 @@ -package org.partiql.ast.helpers +package org.partiql.planner.internal.utils +import org.partiql.ast.Binder import org.partiql.ast.Expr import org.partiql.ast.Identifier import org.partiql.ast.builder.ast @@ -18,7 +19,7 @@ private val col = { index: () -> Int -> "_${index()}" } * * See https://github.com/partiql/partiql-lang-kotlin/issues/1122 */ -public fun Expr.toBinder(index: () -> Int): Identifier.Symbol = when (this) { +public fun Expr.toBinder(index: () -> Int): Binder = when (this) { is Expr.Var -> this.identifier.toBinder() is Expr.Path -> this.toBinder(index) is Expr.Cast -> this.value.toBinder(index) @@ -32,14 +33,21 @@ public fun Expr.toBinder(index: () -> Int): Identifier.Symbol = when (this) { * @param index * @return */ -public fun Expr.toBinder(index: Int): Identifier.Symbol = toBinder { index } +internal fun Expr.toBinder(index: Int): Binder = toBinder { index } -private fun String.toBinder(): Identifier.Symbol = ast { - // Every binder preserves case - identifierSymbol(this@toBinder, Identifier.CaseSensitivity.SENSITIVE) +// Conscious Decision, +// Identifier normalization will be the first step of AST normalization. +// Binder generation then will always be delimited: +// I.e., FROM bAr +// UPPER -> FROM bAr -> FROM "BAR" -> FROM "BAR" AS "BAR" +// DOWN -> FROM bAr -> FROM "bar" -> FROM "bar" AS "bar" +// EXACT -> FROM bAr -> FROM "bAr" -> FROM "bAr" AS "bAr" +// NULL -> FROM bAr -> FROM bAr -> FROM bAr AS "bAr" +private fun String.toBinder(): Binder = ast { + binder(this@toBinder, false) } -private fun Identifier.toBinder(): Identifier.Symbol = when (this@toBinder) { +private fun Identifier.toBinder(): Binder = when (this@toBinder) { is Identifier.Qualified -> when (steps.isEmpty()) { true -> root.symbol.toBinder() else -> steps.last().symbol.toBinder() @@ -48,14 +56,14 @@ private fun Identifier.toBinder(): Identifier.Symbol = when (this@toBinder) { } @OptIn(PartiQLValueExperimental::class) -private fun Expr.Path.toBinder(index: () -> Int): Identifier.Symbol { +private fun Expr.Path.toBinder(index: () -> Int): Binder { if (steps.isEmpty()) return root.toBinder(index) return when (val last = steps.last()) { is Expr.Path.Step.Symbol -> last.symbol.toBinder() is Expr.Path.Step.Index -> { val k = last.key if (k is Expr.Lit && k.value is StringValue) { - k.value.value!!.toBinder() + (k.value as StringValue).value!!.toBinder() } else { col(index).toBinder() } diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/astPasses/NormalizeIdentifierTest.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/astPasses/NormalizeIdentifierTest.kt new file mode 100644 index 0000000000..df7ef0ffe2 --- /dev/null +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/astPasses/NormalizeIdentifierTest.kt @@ -0,0 +1,271 @@ +package org.partiql.planner.internal.astPasses + +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import org.partiql.ast.Binder +import org.partiql.ast.Expr +import org.partiql.ast.From +import org.partiql.ast.Identifier +import org.partiql.ast.Statement +import org.partiql.ast.binder +import org.partiql.ast.builder.ast +import org.partiql.ast.identifierSymbol +import org.partiql.planner.internal.CaseNormalization +import java.util.BitSet +import java.util.stream.Collectors.toList +import java.util.stream.IntStream +import java.util.stream.Stream +import kotlin.test.assertEquals + +internal typealias Setting = Pair + +internal class NormalizeIdentifierTest { + + data class TestCase( + val original: Statement, + val upperCase: Statement, + val lowerCase: Statement, + val exactCase: Statement, + val current: Statement + ) + + enum class Normalization { + UPPER, + LOWER, + EXACT, + NO_OP // original ast + } + + @ArgumentsSource(Provider::class) + @ParameterizedTest + fun tests(tc: TestCase) = runTestCase(tc) + + val passUpper = NormalizeIdentifier(CaseNormalization.UPPERCASE) + + val passLower = NormalizeIdentifier(CaseNormalization.LOWERCASE) + + val passExact = NormalizeIdentifier(CaseNormalization.EXACTCASE) + + val passCurrent = NormalizeIdentifier(null) + + fun runTestCase(tc: TestCase) { + val upper = passUpper.apply(tc.original) + val lower = passLower.apply(tc.original) + val exact = passExact.apply(tc.original) + val current = passCurrent.apply(tc.original) + + assertEquals(expected = tc.upperCase, actual = upper, "Normalized to upper case test failed") + assertEquals(expected = tc.lowerCase, actual = lower, "Normalized to lower case test failed") + assertEquals(expected = tc.exactCase, actual = exact, "Normalized to exact case test failed") + assertEquals(expected = tc.current, actual = current, "current behavior failed") + } + + class Provider() : ArgumentsProvider { + + fun permuteBinary(length: Int) = + IntStream.range(0, Math.pow(2.0, length.toDouble()).toInt()) + .mapToObj { i -> longArrayOf(i.toLong()) } + .map { i -> BitSet.valueOf(i) } + .map { i -> + val booleanList = mutableListOf() + repeat(length) { + booleanList.add(false) + } + i.stream().forEach { i -> booleanList[i] = true } + booleanList.toList() + } + .collect(toList()) + + // SELECT bAr.fOo as fOo FROM tBl as bAr + val varRefBAR: (Setting) -> Identifier.Symbol = { setting -> + val isCaseSensitive = setting.first + val normalization = setting.second + val original = "bAr" + when (normalization) { + Normalization.UPPER -> identifierSymbol( + symbol = if (isCaseSensitive) original else original.uppercase(), + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.LOWER -> identifierSymbol( + symbol = if (isCaseSensitive) original else original.lowercase(), + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.EXACT -> identifierSymbol( + symbol = original, + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.NO_OP -> identifierSymbol( + symbol = original, + caseSensitivity = if (isCaseSensitive) Identifier.CaseSensitivity.SENSITIVE else Identifier.CaseSensitivity.INSENSITIVE + ) + null -> identifierSymbol( + symbol = original, + caseSensitivity = if (isCaseSensitive) Identifier.CaseSensitivity.SENSITIVE else Identifier.CaseSensitivity.INSENSITIVE + ) + } + } + + val varRefFOO: (Setting) -> Identifier.Symbol = { setting -> + val isCaseSensitive = setting.first + val normalization = setting.second + val original = "fOo" + when (normalization) { + Normalization.UPPER -> identifierSymbol( + symbol = if (isCaseSensitive) original else original.uppercase(), + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.LOWER -> identifierSymbol( + symbol = if (isCaseSensitive) original else original.lowercase(), + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.EXACT -> identifierSymbol( + symbol = original, + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.NO_OP -> identifierSymbol( + symbol = original, + caseSensitivity = if (isCaseSensitive) Identifier.CaseSensitivity.SENSITIVE else Identifier.CaseSensitivity.INSENSITIVE + ) + null -> identifierSymbol( + symbol = original, + caseSensitivity = if (isCaseSensitive) Identifier.CaseSensitivity.SENSITIVE else Identifier.CaseSensitivity.INSENSITIVE + ) + } + } + + val varDeclFOO: (Setting) -> Binder = { setting -> + val isCaseSensitive = setting.first + val normalization = setting.second + val original = "fOo" + when (normalization) { + Normalization.UPPER -> binder( + symbol = if (isCaseSensitive) original else original.uppercase(), + isRegular = false + ) + Normalization.LOWER -> binder( + symbol = if (isCaseSensitive) original else original.lowercase(), + isRegular = false + ) + Normalization.EXACT -> binder( + symbol = original, + isRegular = false + ) + Normalization.NO_OP -> binder( + symbol = original, + isRegular = if (isCaseSensitive) false else true + ) + null -> binder( + symbol = original, + false + ) + } + } + + val varRefTBL: (Setting) -> Identifier.Symbol = { setting -> + val isCaseSensitive = setting.first + val normalization = setting.second + val original = "tBl" + when (normalization) { + Normalization.UPPER -> identifierSymbol( + symbol = if (isCaseSensitive) original else original.uppercase(), + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.LOWER -> identifierSymbol( + symbol = if (isCaseSensitive) original else original.lowercase(), + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.EXACT -> identifierSymbol( + symbol = original, + caseSensitivity = Identifier.CaseSensitivity.SENSITIVE + ) + Normalization.NO_OP -> identifierSymbol( + symbol = original, + caseSensitivity = if (isCaseSensitive) Identifier.CaseSensitivity.SENSITIVE else Identifier.CaseSensitivity.INSENSITIVE + ) + null -> identifierSymbol( + symbol = original, + caseSensitivity = if (isCaseSensitive) Identifier.CaseSensitivity.SENSITIVE else Identifier.CaseSensitivity.INSENSITIVE + ) + } + } + + val varDeclBAR: (Setting) -> Binder = { setting -> + val isCaseSensitive = setting.first + val normalization = setting.second + val original = "bAr" + when (normalization) { + Normalization.UPPER -> binder( + symbol = if (isCaseSensitive) original else original.uppercase(), + isRegular = false + ) + Normalization.LOWER -> binder( + symbol = if (isCaseSensitive) original else original.lowercase(), + isRegular = false + ) + Normalization.EXACT -> binder( + symbol = original, + isRegular = false + ) + Normalization.NO_OP -> binder( + symbol = original, + isRegular = if (isCaseSensitive) false else true + ) + null -> binder( + symbol = original, + false + ) + } + } + + val ast: (Setting, Setting, Setting, Setting, Setting) -> Statement = { var_ref_bar, var_ref_foo, var_decl_foo, var_ref_tbl, var_decl_bar -> + ast { + statementQuery { + expr = exprSFW { + select = selectProject { + mutableListOf( + selectProjectItemExpression { + expr = exprPath { + root = exprVar { + identifier = varRefBAR(var_ref_bar) + scope = Expr.Var.Scope.DEFAULT + } + steps = mutableListOf( + exprPathStepSymbol { + symbol = varRefFOO(var_ref_foo) + } + ) + } + asAlias = varDeclFOO(var_decl_foo) + } + ) + } + + from = fromValue { + expr = exprVar { + identifier = varRefTBL(var_ref_tbl) + scope = Expr.Var.Scope.DEFAULT + } + type = From.Value.Type.SCAN + asAlias = varDeclBAR(var_decl_bar) + } + } + } + } + } + + private val tests = permuteBinary(5).map { booleanArray -> + TestCase( + original = ast(booleanArray[0] to Normalization.NO_OP, booleanArray[1] to Normalization.NO_OP, booleanArray[2] to Normalization.NO_OP, booleanArray[3] to Normalization.NO_OP, booleanArray[4] to Normalization.NO_OP), + upperCase = ast(booleanArray[0] to Normalization.UPPER, booleanArray[1] to Normalization.UPPER, booleanArray[2] to Normalization.UPPER, booleanArray[3] to Normalization.UPPER, booleanArray[4] to Normalization.UPPER), + lowerCase = ast(booleanArray[0] to Normalization.LOWER, booleanArray[1] to Normalization.LOWER, booleanArray[2] to Normalization.LOWER, booleanArray[3] to Normalization.LOWER, booleanArray[4] to Normalization.LOWER), + exactCase = ast(booleanArray[0] to Normalization.EXACT, booleanArray[1] to Normalization.EXACT, booleanArray[2] to Normalization.EXACT, booleanArray[3] to Normalization.EXACT, booleanArray[4] to Normalization.EXACT), + current = ast(booleanArray[0] to null, booleanArray[1] to null, booleanArray[2] to null, booleanArray[3] to null, booleanArray[4] to null), + ) + } + + override fun provideArguments(context: ExtensionContext): Stream = + tests.map { org.junit.jupiter.params.provider.Arguments.of(it) }.stream() + } +} diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/transforms/NormalizeSelectTest.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/transforms/NormalizeSelectTest.kt index fb42234794..c6403a0d8e 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/transforms/NormalizeSelectTest.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/transforms/NormalizeSelectTest.kt @@ -5,11 +5,13 @@ import org.partiql.ast.Expr import org.partiql.ast.From import org.partiql.ast.Identifier import org.partiql.ast.Select +import org.partiql.ast.binder import org.partiql.ast.builder.ast import org.partiql.ast.exprLit import org.partiql.ast.exprVar import org.partiql.ast.identifierSymbol import org.partiql.ast.selectProjectItemExpression +import org.partiql.planner.internal.astPasses.NormalizeSelect import org.partiql.value.PartiQLValueExperimental import org.partiql.value.int32Value import org.partiql.value.stringValue @@ -167,12 +169,12 @@ class NormalizeSelectTest { private fun varItem(symbol: String, asAlias: String? = null) = selectProjectItemExpression( expr = variable(symbol), - asAlias = asAlias?.let { identifierSymbol(asAlias, Identifier.CaseSensitivity.INSENSITIVE) } + asAlias = asAlias?.let { binder(asAlias, false) } ) private fun litItem(value: Int, asAlias: String? = null) = selectProjectItemExpression( expr = lit(value), - asAlias = asAlias?.let { identifierSymbol(asAlias, Identifier.CaseSensitivity.INSENSITIVE) } + asAlias = asAlias?.let { binder(asAlias, false) } ) @OptIn(PartiQLValueExperimental::class) diff --git a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt index 481a819cad..c5be097491 100644 --- a/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt +++ b/partiql-planner/src/test/kotlin/org/partiql/planner/internal/typer/PlanTyperTestsPorted.kt @@ -130,7 +130,10 @@ internal class PlanTyperTestsPorted { companion object { private val parser = PartiQLParser.default() - private val planner = PartiQLPlanner.builder().signalMode().build() + private val planner = PartiQLPlanner + .builder() + .signalMode() + .build() private fun assertProblemExists(problem: Problem) = ProblemHandler { problems, ignoreSourceLocation -> val message = buildString {