diff --git a/partiql-ast/api/partiql-ast.api b/partiql-ast/api/partiql-ast.api index ce7f25c0e..4e35fd47c 100644 --- a/partiql-ast/api/partiql-ast.api +++ b/partiql-ast/api/partiql-ast.api @@ -1,13 +1,4 @@ public final class org/partiql/ast/Ast { - 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; - public static final fun constraintDefinitionNullable ()Lorg/partiql/ast/Constraint$Definition$Nullable; - public static final fun constraintDefinitionUnique (Ljava/util/List;Z)Lorg/partiql/ast/Constraint$Definition$Unique; - public static final fun ddlOpCreateIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)Lorg/partiql/ast/DdlOp$CreateIndex; - public static final fun ddlOpCreateTable (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;)Lorg/partiql/ast/DdlOp$CreateTable; - public static final fun ddlOpDropIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/DdlOp$DropIndex; - public static final fun ddlOpDropTable (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/DdlOp$DropTable; public static final fun exclude (Ljava/util/List;)Lorg/partiql/ast/Exclude; public static final fun excludeItem (Lorg/partiql/ast/Expr$Var;Ljava/util/List;)Lorg/partiql/ast/Exclude$Item; public static final fun excludeStepCollIndex (I)Lorg/partiql/ast/Exclude$Step$CollIndex; @@ -90,7 +81,6 @@ public final class org/partiql/ast/Ast { public static final fun onConflictTargetConstraint (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/OnConflict$Target$Constraint; public static final fun onConflictTargetSymbols (Ljava/util/List;)Lorg/partiql/ast/OnConflict$Target$Symbols; public static final fun orderBy (Ljava/util/List;)Lorg/partiql/ast/OrderBy; - public static final fun partitionByAttrList (Ljava/util/List;)Lorg/partiql/ast/PartitionBy$AttrList; public static final fun path (Lorg/partiql/ast/Identifier$Symbol;Ljava/util/List;)Lorg/partiql/ast/Path; public static final fun pathStepIndex (I)Lorg/partiql/ast/Path$Step$Index; public static final fun pathStepSymbol (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/Path$Step$Symbol; @@ -106,7 +96,10 @@ public final class org/partiql/ast/Ast { 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; public static final fun sort (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Sort$Dir;Lorg/partiql/ast/Sort$Nulls;)Lorg/partiql/ast/Sort; - public static final fun statementDDL (Lorg/partiql/ast/DdlOp;)Lorg/partiql/ast/Statement$DDL; + public static final fun statementDDLCreateIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)Lorg/partiql/ast/Statement$DDL$CreateIndex; + public static final fun statementDDLCreateTable (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;)Lorg/partiql/ast/Statement$DDL$CreateTable; + public static final fun statementDDLDropIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/Statement$DDL$DropIndex; + public static final fun statementDDLDropTable (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/Statement$DDL$DropTable; 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; @@ -126,11 +119,13 @@ public final class org/partiql/ast/Ast { 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; public static final fun statementQuery (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Statement$Query; - public static final fun tableDefinition (Ljava/util/List;Ljava/util/List;)Lorg/partiql/ast/TableDefinition; - public static final fun tableDefinitionAttribute (Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;)Lorg/partiql/ast/TableDefinition$Attribute; - public static final fun tableProperty (Ljava/lang/String;Lorg/partiql/value/PartiQLValue;)Lorg/partiql/ast/TableProperty; + public static final fun tableDefinition (Ljava/util/List;)Lorg/partiql/ast/TableDefinition; + public static final fun tableDefinitionColumn (Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;)Lorg/partiql/ast/TableDefinition$Column; + public static final fun tableDefinitionColumnConstraint (Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;)Lorg/partiql/ast/TableDefinition$Column$Constraint; + public static final fun tableDefinitionColumnConstraintBodyCheck (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check; + public static final fun tableDefinitionColumnConstraintBodyNotNull ()Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull; + public static final fun tableDefinitionColumnConstraintBodyNullable ()Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable; public static final fun typeAny ()Lorg/partiql/ast/Type$Any; - public static final fun typeArray (Lorg/partiql/ast/Type;)Lorg/partiql/ast/Type$Array; public static final fun typeBag ()Lorg/partiql/ast/Type$Bag; public static final fun typeBigint ()Lorg/partiql/ast/Type$Bigint; public static final fun typeBit (Ljava/lang/Integer;)Lorg/partiql/ast/Type$Bit; @@ -158,8 +153,7 @@ public final class org/partiql/ast/Ast { public static final fun typeSexp ()Lorg/partiql/ast/Type$Sexp; 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 typeStruct ()Lorg/partiql/ast/Type$Struct; 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; @@ -177,113 +171,6 @@ public abstract class org/partiql/ast/AstNode { public abstract fun getChildren ()Ljava/util/List; } -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; - public final field name Ljava/lang/String; - public fun (Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/ConstraintBuilder; - public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Lorg/partiql/ast/Constraint$Definition; - public final fun copy (Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;)Lorg/partiql/ast/Constraint; - public static synthetic fun copy$default (Lorg/partiql/ast/Constraint;Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;ILjava/lang/Object;)Lorg/partiql/ast/Constraint; - 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/Constraint$Companion { - public final fun builder ()Lorg/partiql/ast/builder/ConstraintBuilder; -} - -public abstract class org/partiql/ast/Constraint$Definition : org/partiql/ast/AstNode { - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; -} - -public final class org/partiql/ast/Constraint$Definition$Check : org/partiql/ast/Constraint$Definition { - public static final field Companion Lorg/partiql/ast/Constraint$Definition$Check$Companion; - public final field expr Lorg/partiql/ast/Expr; - public fun (Lorg/partiql/ast/Expr;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/ConstraintDefinitionCheckBuilder; - public final fun component1 ()Lorg/partiql/ast/Expr; - public final fun copy (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/Constraint$Definition$Check; - public static synthetic fun copy$default (Lorg/partiql/ast/Constraint$Definition$Check;Lorg/partiql/ast/Expr;ILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$Check; - 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/Constraint$Definition$Check$Companion { - public final fun builder ()Lorg/partiql/ast/builder/ConstraintDefinitionCheckBuilder; -} - -public final class org/partiql/ast/Constraint$Definition$NotNull : org/partiql/ast/Constraint$Definition { - public final field C - public static final field Companion Lorg/partiql/ast/Constraint$Definition$NotNull$Companion; - public fun ()V - public fun (C)V - public synthetic fun (CILkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/ConstraintDefinitionNotNullBuilder; - public final fun component1 ()C - public final fun copy (C)Lorg/partiql/ast/Constraint$Definition$NotNull; - public static synthetic fun copy$default (Lorg/partiql/ast/Constraint$Definition$NotNull;CILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$NotNull; - 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/Constraint$Definition$NotNull$Companion { - public final fun builder ()Lorg/partiql/ast/builder/ConstraintDefinitionNotNullBuilder; -} - -public final class org/partiql/ast/Constraint$Definition$Nullable : org/partiql/ast/Constraint$Definition { - public final field C - public static final field Companion Lorg/partiql/ast/Constraint$Definition$Nullable$Companion; - public fun ()V - public fun (C)V - public synthetic fun (CILkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/ConstraintDefinitionNullableBuilder; - public final fun component1 ()C - public final fun copy (C)Lorg/partiql/ast/Constraint$Definition$Nullable; - public static synthetic fun copy$default (Lorg/partiql/ast/Constraint$Definition$Nullable;CILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$Nullable; - 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/Constraint$Definition$Nullable$Companion { - public final fun builder ()Lorg/partiql/ast/builder/ConstraintDefinitionNullableBuilder; -} - -public final class org/partiql/ast/Constraint$Definition$Unique : org/partiql/ast/Constraint$Definition { - public static final field Companion Lorg/partiql/ast/Constraint$Definition$Unique$Companion; - public final field attributes Ljava/util/List; - public final field isPrimaryKey Z - public fun (Ljava/util/List;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/ConstraintDefinitionUniqueBuilder; - public final fun component1 ()Ljava/util/List; - public final fun component2 ()Z - public final fun copy (Ljava/util/List;Z)Lorg/partiql/ast/Constraint$Definition$Unique; - public static synthetic fun copy$default (Lorg/partiql/ast/Constraint$Definition$Unique;Ljava/util/List;ZILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$Unique; - 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/Constraint$Definition$Unique$Companion { - public final fun builder ()Lorg/partiql/ast/builder/ConstraintDefinitionUniqueBuilder; -} - public final class org/partiql/ast/DatetimeField : java/lang/Enum { public static final field DAY Lorg/partiql/ast/DatetimeField; public static final field HOUR Lorg/partiql/ast/DatetimeField; @@ -297,98 +184,6 @@ public final class org/partiql/ast/DatetimeField : java/lang/Enum { public static fun values ()[Lorg/partiql/ast/DatetimeField; } -public abstract class org/partiql/ast/DdlOp : org/partiql/ast/AstNode { - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; -} - -public final class org/partiql/ast/DdlOp$CreateIndex : org/partiql/ast/DdlOp { - public static final field Companion Lorg/partiql/ast/DdlOp$CreateIndex$Companion; - public final field fields Ljava/util/List; - public final field index Lorg/partiql/ast/Identifier; - public final field table Lorg/partiql/ast/Identifier; - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/DdlOpCreateIndexBuilder; - public final fun component1 ()Lorg/partiql/ast/Identifier; - public final fun component2 ()Lorg/partiql/ast/Identifier; - public final fun component3 ()Ljava/util/List; - public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)Lorg/partiql/ast/DdlOp$CreateIndex; - public static synthetic fun copy$default (Lorg/partiql/ast/DdlOp$CreateIndex;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$CreateIndex; - 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/DdlOp$CreateIndex$Companion { - public final fun builder ()Lorg/partiql/ast/builder/DdlOpCreateIndexBuilder; -} - -public final class org/partiql/ast/DdlOp$CreateTable : org/partiql/ast/DdlOp { - public static final field Companion Lorg/partiql/ast/DdlOp$CreateTable$Companion; - public final field definition Lorg/partiql/ast/TableDefinition; - public final field name Lorg/partiql/ast/Identifier; - public final field partitionBy Lorg/partiql/ast/PartitionBy; - public final field tableProperties Ljava/util/List; - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/DdlOpCreateTableBuilder; - public final fun component1 ()Lorg/partiql/ast/Identifier; - public final fun component2 ()Lorg/partiql/ast/TableDefinition; - public final fun component3 ()Lorg/partiql/ast/PartitionBy; - public final fun component4 ()Ljava/util/List; - public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;)Lorg/partiql/ast/DdlOp$CreateTable; - public static synthetic fun copy$default (Lorg/partiql/ast/DdlOp$CreateTable;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$CreateTable; - 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/DdlOp$CreateTable$Companion { - public final fun builder ()Lorg/partiql/ast/builder/DdlOpCreateTableBuilder; -} - -public final class org/partiql/ast/DdlOp$DropIndex : org/partiql/ast/DdlOp { - public static final field Companion Lorg/partiql/ast/DdlOp$DropIndex$Companion; - public final field index Lorg/partiql/ast/Identifier; - public final field table Lorg/partiql/ast/Identifier; - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/DdlOpDropIndexBuilder; - public final fun component1 ()Lorg/partiql/ast/Identifier; - public final fun component2 ()Lorg/partiql/ast/Identifier; - public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/DdlOp$DropIndex; - public static synthetic fun copy$default (Lorg/partiql/ast/DdlOp$DropIndex;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$DropIndex; - 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/DdlOp$DropIndex$Companion { - public final fun builder ()Lorg/partiql/ast/builder/DdlOpDropIndexBuilder; -} - -public final class org/partiql/ast/DdlOp$DropTable : org/partiql/ast/DdlOp { - public static final field Companion Lorg/partiql/ast/DdlOp$DropTable$Companion; - public final field table Lorg/partiql/ast/Identifier; - public fun (Lorg/partiql/ast/Identifier;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/DdlOpDropTableBuilder; - public final fun component1 ()Lorg/partiql/ast/Identifier; - public final fun copy (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/DdlOp$DropTable; - public static synthetic fun copy$default (Lorg/partiql/ast/DdlOp$DropTable;Lorg/partiql/ast/Identifier;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$DropTable; - 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/DdlOp$DropTable$Companion { - public final fun builder ()Lorg/partiql/ast/builder/DdlOpDropTableBuilder; -} - public final class org/partiql/ast/Exclude : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/Exclude$Companion; public final field items Ljava/util/List; @@ -2277,29 +2072,6 @@ public final class org/partiql/ast/OrderBy$Companion { public final fun builder ()Lorg/partiql/ast/builder/OrderByBuilder; } -public abstract class org/partiql/ast/PartitionBy : org/partiql/ast/AstNode { - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; -} - -public final class org/partiql/ast/PartitionBy$AttrList : org/partiql/ast/PartitionBy { - public static final field Companion Lorg/partiql/ast/PartitionBy$AttrList$Companion; - public final field list Ljava/util/List; - public fun (Ljava/util/List;)V - public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/PartitionByAttrListBuilder; - public final fun component1 ()Ljava/util/List; - public final fun copy (Ljava/util/List;)Lorg/partiql/ast/PartitionBy$AttrList; - public static synthetic fun copy$default (Lorg/partiql/ast/PartitionBy$AttrList;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/PartitionBy$AttrList; - 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/PartitionBy$AttrList$Companion { - public final fun builder ()Lorg/partiql/ast/builder/PartitionByAttrListBuilder; -} - public final class org/partiql/ast/Path : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/Path$Companion; public final field root Lorg/partiql/ast/Identifier$Symbol; @@ -2670,23 +2442,92 @@ public abstract class org/partiql/ast/Statement : org/partiql/ast/AstNode { public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; } -public final class org/partiql/ast/Statement$DDL : org/partiql/ast/Statement { - public static final field Companion Lorg/partiql/ast/Statement$DDL$Companion; - public final field op Lorg/partiql/ast/DdlOp; - public fun (Lorg/partiql/ast/DdlOp;)V +public abstract class org/partiql/ast/Statement$DDL : org/partiql/ast/Statement { + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; +} + +public final class org/partiql/ast/Statement$DDL$CreateIndex : org/partiql/ast/Statement$DDL { + public static final field Companion Lorg/partiql/ast/Statement$DDL$CreateIndex$Companion; + public final field fields Ljava/util/List; + public final field index Lorg/partiql/ast/Identifier; + public final field table Lorg/partiql/ast/Identifier; + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/StatementDdlBuilder; - public final fun component1 ()Lorg/partiql/ast/DdlOp; - public final fun copy (Lorg/partiql/ast/DdlOp;)Lorg/partiql/ast/Statement$DDL; - public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DDL;Lorg/partiql/ast/DdlOp;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL; + public static final fun builder ()Lorg/partiql/ast/builder/StatementDdlCreateIndexBuilder; + public final fun component1 ()Lorg/partiql/ast/Identifier; + public final fun component2 ()Lorg/partiql/ast/Identifier; + public final fun component3 ()Ljava/util/List; + public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)Lorg/partiql/ast/Statement$DDL$CreateIndex; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DDL$CreateIndex;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$CreateIndex; 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/Statement$DDL$Companion { - public final fun builder ()Lorg/partiql/ast/builder/StatementDdlBuilder; +public final class org/partiql/ast/Statement$DDL$CreateIndex$Companion { + public final fun builder ()Lorg/partiql/ast/builder/StatementDdlCreateIndexBuilder; +} + +public final class org/partiql/ast/Statement$DDL$CreateTable : org/partiql/ast/Statement$DDL { + public static final field Companion Lorg/partiql/ast/Statement$DDL$CreateTable$Companion; + public final field definition Lorg/partiql/ast/TableDefinition; + public final field name Lorg/partiql/ast/Identifier; + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;)V + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; + public static final fun builder ()Lorg/partiql/ast/builder/StatementDdlCreateTableBuilder; + public final fun component1 ()Lorg/partiql/ast/Identifier; + public final fun component2 ()Lorg/partiql/ast/TableDefinition; + public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;)Lorg/partiql/ast/Statement$DDL$CreateTable; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DDL$CreateTable;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$CreateTable; + 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/Statement$DDL$CreateTable$Companion { + public final fun builder ()Lorg/partiql/ast/builder/StatementDdlCreateTableBuilder; +} + +public final class org/partiql/ast/Statement$DDL$DropIndex : org/partiql/ast/Statement$DDL { + public static final field Companion Lorg/partiql/ast/Statement$DDL$DropIndex$Companion; + public final field index Lorg/partiql/ast/Identifier; + public final field table Lorg/partiql/ast/Identifier; + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)V + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; + public static final fun builder ()Lorg/partiql/ast/builder/StatementDdlDropIndexBuilder; + public final fun component1 ()Lorg/partiql/ast/Identifier; + public final fun component2 ()Lorg/partiql/ast/Identifier; + public final fun copy (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/Statement$DDL$DropIndex; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DDL$DropIndex;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$DropIndex; + 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/Statement$DDL$DropIndex$Companion { + public final fun builder ()Lorg/partiql/ast/builder/StatementDdlDropIndexBuilder; +} + +public final class org/partiql/ast/Statement$DDL$DropTable : org/partiql/ast/Statement$DDL { + public static final field Companion Lorg/partiql/ast/Statement$DDL$DropTable$Companion; + public final field table Lorg/partiql/ast/Identifier; + public fun (Lorg/partiql/ast/Identifier;)V + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; + public static final fun builder ()Lorg/partiql/ast/builder/StatementDdlDropTableBuilder; + public final fun component1 ()Lorg/partiql/ast/Identifier; + public final fun copy (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/Statement$DDL$DropTable; + public static synthetic fun copy$default (Lorg/partiql/ast/Statement$DDL$DropTable;Lorg/partiql/ast/Identifier;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$DropTable; + 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/Statement$DDL$DropTable$Companion { + public final fun builder ()Lorg/partiql/ast/builder/StatementDdlDropTableBuilder; } public abstract class org/partiql/ast/Statement$DML : org/partiql/ast/Statement { @@ -3124,115 +2965,155 @@ public final class org/partiql/ast/Statement$Query$Companion { public final class org/partiql/ast/TableDefinition : org/partiql/ast/AstNode { public static final field Companion Lorg/partiql/ast/TableDefinition$Companion; - public final field attributes Ljava/util/List; - public final field constraints Ljava/util/List; - public fun (Ljava/util/List;Ljava/util/List;)V + public final field columns Ljava/util/List; + public fun (Ljava/util/List;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/ast/builder/TableDefinitionBuilder; public final fun component1 ()Ljava/util/List; - public final fun component2 ()Ljava/util/List; - public final fun copy (Ljava/util/List;Ljava/util/List;)Lorg/partiql/ast/TableDefinition; - public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition; + public final fun copy (Ljava/util/List;)Lorg/partiql/ast/TableDefinition; + public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition; 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/TableDefinition$Attribute : org/partiql/ast/AstNode { - public static final field Companion Lorg/partiql/ast/TableDefinition$Attribute$Companion; - public final field comment Ljava/lang/String; +public final class org/partiql/ast/TableDefinition$Column : org/partiql/ast/AstNode { + public static final field Companion Lorg/partiql/ast/TableDefinition$Column$Companion; 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 Ljava/lang/String; 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 (Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/TableDefinitionAttributeBuilder; - public final fun component1 ()Lorg/partiql/ast/Identifier$Symbol; + public static final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnBuilder; + public final fun component1 ()Ljava/lang/String; 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/TableDefinition$Attribute; - public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition$Attribute;Lorg/partiql/ast/Identifier$Symbol;Lorg/partiql/ast/Type;Ljava/util/List;ZLjava/lang/String;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Attribute; + public final fun copy (Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;)Lorg/partiql/ast/TableDefinition$Column; + public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition$Column;Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column; 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/TableDefinition$Attribute$Companion { - public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionAttributeBuilder; +public final class org/partiql/ast/TableDefinition$Column$Companion { + public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnBuilder; } -public final class org/partiql/ast/TableDefinition$Companion { - public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionBuilder; -} - -public final class org/partiql/ast/TableProperty : org/partiql/ast/AstNode { - public static final field Companion Lorg/partiql/ast/TableProperty$Companion; +public final class org/partiql/ast/TableDefinition$Column$Constraint : org/partiql/ast/AstNode { + public static final field Companion Lorg/partiql/ast/TableDefinition$Column$Constraint$Companion; + public final field body Lorg/partiql/ast/TableDefinition$Column$Constraint$Body; public final field name Ljava/lang/String; - public final field value Lorg/partiql/value/PartiQLValue; - public fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValue;)V + public fun (Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/TablePropertyBuilder; + public static final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBuilder; public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Lorg/partiql/value/PartiQLValue; - public final fun copy (Ljava/lang/String;Lorg/partiql/value/PartiQLValue;)Lorg/partiql/ast/TableProperty; - public static synthetic fun copy$default (Lorg/partiql/ast/TableProperty;Ljava/lang/String;Lorg/partiql/value/PartiQLValue;ILjava/lang/Object;)Lorg/partiql/ast/TableProperty; + public final fun component2 ()Lorg/partiql/ast/TableDefinition$Column$Constraint$Body; + public final fun copy (Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;)Lorg/partiql/ast/TableDefinition$Column$Constraint; + public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition$Column$Constraint;Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint; 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/TableProperty$Companion { - public final fun builder ()Lorg/partiql/ast/builder/TablePropertyBuilder; +public abstract class org/partiql/ast/TableDefinition$Column$Constraint$Body : org/partiql/ast/AstNode { + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; } -public abstract class org/partiql/ast/Type : org/partiql/ast/AstNode { +public final class org/partiql/ast/TableDefinition$Column$Constraint$Body$Check : org/partiql/ast/TableDefinition$Column$Constraint$Body { + public static final field Companion Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check$Companion; + public final field expr Lorg/partiql/ast/Expr; + public fun (Lorg/partiql/ast/Expr;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; + public static final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBodyCheckBuilder; + public final fun component1 ()Lorg/partiql/ast/Expr; + public final fun copy (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check; + public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check;Lorg/partiql/ast/Expr;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check; + 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/Type$Any : org/partiql/ast/Type { +public final class org/partiql/ast/TableDefinition$Column$Constraint$Body$Check$Companion { + public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBodyCheckBuilder; +} + +public final class org/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull : org/partiql/ast/TableDefinition$Column$Constraint$Body { public final field C - public static final field Companion Lorg/partiql/ast/Type$Any$Companion; + public static final field Companion Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull$Companion; public fun ()V public fun (C)V public synthetic fun (CILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/TypeAnyBuilder; + public static final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBodyNotNullBuilder; public final fun component1 ()C - public final fun copy (C)Lorg/partiql/ast/Type$Any; - public static synthetic fun copy$default (Lorg/partiql/ast/Type$Any;CILjava/lang/Object;)Lorg/partiql/ast/Type$Any; + public final fun copy (C)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull; + public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull;CILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull; 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/Type$Any$Companion { - public final fun builder ()Lorg/partiql/ast/builder/TypeAnyBuilder; +public final class org/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull$Companion { + public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBodyNotNullBuilder; } -public final class org/partiql/ast/Type$Array : org/partiql/ast/Type { - public static final field Companion Lorg/partiql/ast/Type$Array$Companion; - public final field type Lorg/partiql/ast/Type; - public fun (Lorg/partiql/ast/Type;)V +public final class org/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable : org/partiql/ast/TableDefinition$Column$Constraint$Body { + public final field C + public static final field Companion Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable$Companion; + public fun ()V + public fun (C)V + public synthetic fun (CILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; + public static final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBodyNullableBuilder; + public final fun component1 ()C + public final fun copy (C)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable; + public static synthetic fun copy$default (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable;CILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable; + 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/TableDefinition$Column$Constraint$Body$Nullable$Companion { + public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBodyNullableBuilder; +} + +public final class org/partiql/ast/TableDefinition$Column$Constraint$Companion { + public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBuilder; +} + +public final class org/partiql/ast/TableDefinition$Companion { + public final fun builder ()Lorg/partiql/ast/builder/TableDefinitionBuilder; +} + +public abstract class org/partiql/ast/Type : org/partiql/ast/AstNode { + public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; +} + +public final class org/partiql/ast/Type$Any : org/partiql/ast/Type { + public final field C + public static final field Companion Lorg/partiql/ast/Type$Any$Companion; + public fun ()V + public fun (C)V + public synthetic fun (CILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; - public static final fun builder ()Lorg/partiql/ast/builder/TypeArrayBuilder; - public final fun component1 ()Lorg/partiql/ast/Type; - public final fun copy (Lorg/partiql/ast/Type;)Lorg/partiql/ast/Type$Array; - public static synthetic fun copy$default (Lorg/partiql/ast/Type$Array;Lorg/partiql/ast/Type;ILjava/lang/Object;)Lorg/partiql/ast/Type$Array; + public static final fun builder ()Lorg/partiql/ast/builder/TypeAnyBuilder; + public final fun component1 ()C + public final fun copy (C)Lorg/partiql/ast/Type$Any; + public static synthetic fun copy$default (Lorg/partiql/ast/Type$Any;CILjava/lang/Object;)Lorg/partiql/ast/Type$Any; 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/Type$Array$Companion { - public final fun builder ()Lorg/partiql/ast/builder/TypeArrayBuilder; +public final class org/partiql/ast/Type$Any$Companion { + public final fun builder ()Lorg/partiql/ast/builder/TypeAnyBuilder; } public final class org/partiql/ast/Type$Bag : org/partiql/ast/Type { @@ -3785,14 +3666,16 @@ public final class org/partiql/ast/Type$String$Companion { } public final class org/partiql/ast/Type$Struct : org/partiql/ast/Type { + public final field C public static final field Companion Lorg/partiql/ast/Type$Struct$Companion; - public final field fields Ljava/util/List; - public fun (Ljava/util/List;)V + public fun ()V + public fun (C)V + public synthetic fun (CILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun accept (Lorg/partiql/ast/visitor/AstVisitor;Ljava/lang/Object;)Ljava/lang/Object; public static final fun builder ()Lorg/partiql/ast/builder/TypeStructBuilder; - public final fun component1 ()Ljava/util/List; - public final fun copy (Ljava/util/List;)Lorg/partiql/ast/Type$Struct; - public static synthetic fun copy$default (Lorg/partiql/ast/Type$Struct;Ljava/util/List;ILjava/lang/Object;)Lorg/partiql/ast/Type$Struct; + public final fun component1 ()C + public final fun copy (C)Lorg/partiql/ast/Type$Struct; + public static synthetic fun copy$default (Lorg/partiql/ast/Type$Struct;CILjava/lang/Object;)Lorg/partiql/ast/Type$Struct; public fun equals (Ljava/lang/Object;)Z public fun getChildren ()Ljava/util/List; public fun hashCode ()I @@ -3803,33 +3686,6 @@ public final class org/partiql/ast/Type$Struct$Companion { public final fun builder ()Lorg/partiql/ast/builder/TypeStructBuilder; } -public final class org/partiql/ast/Type$Struct$Field : org/partiql/ast/AstNode { - public static final field Companion Lorg/partiql/ast/Type$Struct$Field$Companion; - 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 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 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 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 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/Type$Struct$Field$Companion { - public final fun builder ()Lorg/partiql/ast/builder/TypeStructFieldBuilder; -} - public final class org/partiql/ast/Type$Symbol : org/partiql/ast/Type { public final field C public static final field Companion Lorg/partiql/ast/Type$Symbol$Companion; @@ -3990,24 +3846,6 @@ public final class org/partiql/ast/Type$Varchar$Companion { public final class org/partiql/ast/builder/AstBuilder { public fun ()V - 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; - public static synthetic fun constraintDefinitionCheck$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$Check; - public final fun constraintDefinitionNotNull (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Constraint$Definition$NotNull; - public static synthetic fun constraintDefinitionNotNull$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$NotNull; - public final fun constraintDefinitionNullable (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Constraint$Definition$Nullable; - public static synthetic fun constraintDefinitionNullable$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$Nullable; - public final fun constraintDefinitionUnique (Ljava/util/List;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Constraint$Definition$Unique; - public static synthetic fun constraintDefinitionUnique$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Constraint$Definition$Unique; - public final fun ddlOpCreateIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/DdlOp$CreateIndex; - public static synthetic fun ddlOpCreateIndex$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$CreateIndex; - public final fun ddlOpCreateTable (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/DdlOp$CreateTable; - public static synthetic fun ddlOpCreateTable$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$CreateTable; - public final fun ddlOpDropIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/DdlOp$DropIndex; - public static synthetic fun ddlOpDropIndex$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$DropIndex; - public final fun ddlOpDropTable (Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/DdlOp$DropTable; - public static synthetic fun ddlOpDropTable$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/DdlOp$DropTable; public final fun exclude (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Exclude; public static synthetic fun exclude$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Exclude; public final fun excludeItem (Lorg/partiql/ast/Expr$Var;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Exclude$Item; @@ -4172,8 +4010,6 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun onConflictTargetSymbols$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/OnConflict$Target$Symbols; public final fun orderBy (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/OrderBy; public static synthetic fun orderBy$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/OrderBy; - public final fun partitionByAttrList (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/PartitionBy$AttrList; - public static synthetic fun partitionByAttrList$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/PartitionBy$AttrList; public final fun path (Lorg/partiql/ast/Identifier$Symbol;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Path; public static synthetic fun path$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier$Symbol;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Path; public final fun pathStepIndex (Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Path$Step$Index; @@ -4204,8 +4040,14 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun setOp$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/SetOp$Type;Lorg/partiql/ast/SetQuantifier;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/SetOp; public final fun sort (Lorg/partiql/ast/Expr;Lorg/partiql/ast/Sort$Dir;Lorg/partiql/ast/Sort$Nulls;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Sort; public static synthetic fun sort$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Sort$Dir;Lorg/partiql/ast/Sort$Nulls;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Sort; - public final fun statementDDL (Lorg/partiql/ast/DdlOp;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DDL; - public static synthetic fun statementDDL$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/DdlOp;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL; + public final fun statementDDLCreateIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DDL$CreateIndex; + public static synthetic fun statementDDLCreateIndex$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$CreateIndex; + public final fun statementDDLCreateTable (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DDL$CreateTable; + public static synthetic fun statementDDLCreateTable$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$CreateTable; + public final fun statementDDLDropIndex (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DDL$DropIndex; + public static synthetic fun statementDDLDropIndex$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$DropIndex; + public final fun statementDDLDropTable (Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DDL$DropTable; + public static synthetic fun statementDDLDropTable$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Identifier;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$DDL$DropTable; public final fun statementDMLBatchLegacy (Ljava/util/List;Lorg/partiql/ast/From;Lorg/partiql/ast/Expr;Lorg/partiql/ast/Returning;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$DML$BatchLegacy; 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; @@ -4244,16 +4086,20 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun statementExplainTargetDomain$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Statement;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$Explain$Target$Domain; public final fun statementQuery (Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Statement$Query; public static synthetic fun statementQuery$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Statement$Query; - public final fun tableDefinition (Ljava/util/List;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableDefinition; - public static synthetic fun tableDefinition$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition; - public final fun tableDefinitionAttribute (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/TableDefinition$Attribute; - public static synthetic fun tableDefinitionAttribute$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/TableDefinition$Attribute; - public final fun tableProperty (Ljava/lang/String;Lorg/partiql/value/PartiQLValue;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableProperty; - public static synthetic fun tableProperty$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/String;Lorg/partiql/value/PartiQLValue;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableProperty; + public final fun tableDefinition (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableDefinition; + public static synthetic fun tableDefinition$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition; + public final fun tableDefinitionColumn (Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableDefinition$Column; + public static synthetic fun tableDefinitionColumn$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column; + public final fun tableDefinitionColumnConstraint (Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableDefinition$Column$Constraint; + public static synthetic fun tableDefinitionColumnConstraint$default (Lorg/partiql/ast/builder/AstBuilder;Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint; + public final fun tableDefinitionColumnConstraintBodyCheck (Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check; + public static synthetic fun tableDefinitionColumnConstraintBodyCheck$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Expr;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check; + public final fun tableDefinitionColumnConstraintBodyNotNull (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull; + public static synthetic fun tableDefinitionColumnConstraintBodyNotNull$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull; + public final fun tableDefinitionColumnConstraintBodyNullable (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable; + public static synthetic fun tableDefinitionColumnConstraintBodyNullable$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable; public final fun typeAny (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Any; public static synthetic fun typeAny$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Any; - public final fun typeArray (Lorg/partiql/ast/Type;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Array; - public static synthetic fun typeArray$default (Lorg/partiql/ast/builder/AstBuilder;Lorg/partiql/ast/Type;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Array; public final fun typeBag (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Bag; public static synthetic fun typeBag$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Bag; public final fun typeBigint (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Bigint; @@ -4308,10 +4154,8 @@ public final class org/partiql/ast/builder/AstBuilder { public static synthetic fun typeSmallint$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Smallint; public final fun typeString (Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$String; 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 typeStruct (Lkotlin/jvm/functions/Function1;)Lorg/partiql/ast/Type$Struct; + public static synthetic fun typeStruct$default (Lorg/partiql/ast/builder/AstBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/partiql/ast/Type$Struct; 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; @@ -4334,110 +4178,6 @@ 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/ConstraintBuilder { - public fun ()V - public fun (Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;)V - public synthetic fun (Ljava/lang/String;Lorg/partiql/ast/Constraint$Definition;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/Constraint; - public final fun definition (Lorg/partiql/ast/Constraint$Definition;)Lorg/partiql/ast/builder/ConstraintBuilder; - public final fun getDefinition ()Lorg/partiql/ast/Constraint$Definition; - public final fun getName ()Ljava/lang/String; - public final fun name (Ljava/lang/String;)Lorg/partiql/ast/builder/ConstraintBuilder; - public final fun setDefinition (Lorg/partiql/ast/Constraint$Definition;)V - public final fun setName (Ljava/lang/String;)V -} - -public final class org/partiql/ast/builder/ConstraintDefinitionCheckBuilder { - public fun ()V - public fun (Lorg/partiql/ast/Expr;)V - public synthetic fun (Lorg/partiql/ast/Expr;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/Constraint$Definition$Check; - public final fun expr (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/builder/ConstraintDefinitionCheckBuilder; - public final fun getExpr ()Lorg/partiql/ast/Expr; - public final fun setExpr (Lorg/partiql/ast/Expr;)V -} - -public final class org/partiql/ast/builder/ConstraintDefinitionNotNullBuilder { - public fun ()V - public final fun build ()Lorg/partiql/ast/Constraint$Definition$NotNull; -} - -public final class org/partiql/ast/builder/ConstraintDefinitionNullableBuilder { - public fun ()V - public final fun build ()Lorg/partiql/ast/Constraint$Definition$Nullable; -} - -public final class org/partiql/ast/builder/ConstraintDefinitionUniqueBuilder { - public fun ()V - public fun (Ljava/util/List;Ljava/lang/Boolean;)V - public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun attributes (Ljava/util/List;)Lorg/partiql/ast/builder/ConstraintDefinitionUniqueBuilder; - public final fun build ()Lorg/partiql/ast/Constraint$Definition$Unique; - public final fun getAttributes ()Ljava/util/List; - public final fun isPrimaryKey ()Ljava/lang/Boolean; - public final fun isPrimaryKey (Ljava/lang/Boolean;)Lorg/partiql/ast/builder/ConstraintDefinitionUniqueBuilder; - public final fun setAttributes (Ljava/util/List;)V - public final fun setPrimaryKey (Ljava/lang/Boolean;)V -} - -public final class org/partiql/ast/builder/DdlOpCreateIndexBuilder { - public fun ()V - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)V - public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/DdlOp$CreateIndex; - public final fun fields (Ljava/util/List;)Lorg/partiql/ast/builder/DdlOpCreateIndexBuilder; - public final fun getFields ()Ljava/util/List; - public final fun getIndex ()Lorg/partiql/ast/Identifier; - public final fun getTable ()Lorg/partiql/ast/Identifier; - public final fun index (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/DdlOpCreateIndexBuilder; - public final fun setFields (Ljava/util/List;)V - public final fun setIndex (Lorg/partiql/ast/Identifier;)V - public final fun setTable (Lorg/partiql/ast/Identifier;)V - public final fun table (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/DdlOpCreateIndexBuilder; -} - -public final class org/partiql/ast/builder/DdlOpCreateTableBuilder { - public fun ()V - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;)V - public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;Lorg/partiql/ast/PartitionBy;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/DdlOp$CreateTable; - public final fun definition (Lorg/partiql/ast/TableDefinition;)Lorg/partiql/ast/builder/DdlOpCreateTableBuilder; - public final fun getDefinition ()Lorg/partiql/ast/TableDefinition; - public final fun getName ()Lorg/partiql/ast/Identifier; - public final fun getPartitionBy ()Lorg/partiql/ast/PartitionBy; - public final fun getTableProperties ()Ljava/util/List; - public final fun name (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/DdlOpCreateTableBuilder; - public final fun partitionBy (Lorg/partiql/ast/PartitionBy;)Lorg/partiql/ast/builder/DdlOpCreateTableBuilder; - public final fun setDefinition (Lorg/partiql/ast/TableDefinition;)V - public final fun setName (Lorg/partiql/ast/Identifier;)V - public final fun setPartitionBy (Lorg/partiql/ast/PartitionBy;)V - public final fun setTableProperties (Ljava/util/List;)V - public final fun tableProperties (Ljava/util/List;)Lorg/partiql/ast/builder/DdlOpCreateTableBuilder; -} - -public final class org/partiql/ast/builder/DdlOpDropIndexBuilder { - public fun ()V - public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)V - public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/DdlOp$DropIndex; - public final fun getIndex ()Lorg/partiql/ast/Identifier; - public final fun getTable ()Lorg/partiql/ast/Identifier; - public final fun index (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/DdlOpDropIndexBuilder; - public final fun setIndex (Lorg/partiql/ast/Identifier;)V - public final fun setTable (Lorg/partiql/ast/Identifier;)V - public final fun table (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/DdlOpDropIndexBuilder; -} - -public final class org/partiql/ast/builder/DdlOpDropTableBuilder { - public fun ()V - public fun (Lorg/partiql/ast/Identifier;)V - public synthetic fun (Lorg/partiql/ast/Identifier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/DdlOp$DropTable; - public final fun getTable ()Lorg/partiql/ast/Identifier; - public final fun setTable (Lorg/partiql/ast/Identifier;)V - public final fun table (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/DdlOpDropTableBuilder; -} - public final class org/partiql/ast/builder/ExcludeBuilder { public fun ()V public fun (Ljava/util/List;)V @@ -5480,16 +5220,6 @@ public final class org/partiql/ast/builder/OrderByBuilder { public final fun sorts (Ljava/util/List;)Lorg/partiql/ast/builder/OrderByBuilder; } -public final class org/partiql/ast/builder/PartitionByAttrListBuilder { - public fun ()V - public fun (Ljava/util/List;)V - public synthetic fun (Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/PartitionBy$AttrList; - public final fun getList ()Ljava/util/List; - public final fun list (Ljava/util/List;)Lorg/partiql/ast/builder/PartitionByAttrListBuilder; - public final fun setList (Ljava/util/List;)V -} - public final class org/partiql/ast/builder/PathBuilder { public fun ()V public fun (Lorg/partiql/ast/Identifier$Symbol;Ljava/util/List;)V @@ -5665,14 +5395,56 @@ public final class org/partiql/ast/builder/SortBuilder { public final fun setNulls (Lorg/partiql/ast/Sort$Nulls;)V } -public final class org/partiql/ast/builder/StatementDdlBuilder { +public final class org/partiql/ast/builder/StatementDdlCreateIndexBuilder { + public fun ()V + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;)V + public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/Statement$DDL$CreateIndex; + public final fun fields (Ljava/util/List;)Lorg/partiql/ast/builder/StatementDdlCreateIndexBuilder; + public final fun getFields ()Ljava/util/List; + public final fun getIndex ()Lorg/partiql/ast/Identifier; + public final fun getTable ()Lorg/partiql/ast/Identifier; + public final fun index (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDdlCreateIndexBuilder; + public final fun setFields (Ljava/util/List;)V + public final fun setIndex (Lorg/partiql/ast/Identifier;)V + public final fun setTable (Lorg/partiql/ast/Identifier;)V + public final fun table (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDdlCreateIndexBuilder; +} + +public final class org/partiql/ast/builder/StatementDdlCreateTableBuilder { + public fun ()V + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;)V + public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/TableDefinition;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/Statement$DDL$CreateTable; + public final fun definition (Lorg/partiql/ast/TableDefinition;)Lorg/partiql/ast/builder/StatementDdlCreateTableBuilder; + public final fun getDefinition ()Lorg/partiql/ast/TableDefinition; + public final fun getName ()Lorg/partiql/ast/Identifier; + public final fun name (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDdlCreateTableBuilder; + public final fun setDefinition (Lorg/partiql/ast/TableDefinition;)V + public final fun setName (Lorg/partiql/ast/Identifier;)V +} + +public final class org/partiql/ast/builder/StatementDdlDropIndexBuilder { + public fun ()V + public fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;)V + public synthetic fun (Lorg/partiql/ast/Identifier;Lorg/partiql/ast/Identifier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/Statement$DDL$DropIndex; + public final fun getIndex ()Lorg/partiql/ast/Identifier; + public final fun getTable ()Lorg/partiql/ast/Identifier; + public final fun index (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDdlDropIndexBuilder; + public final fun setIndex (Lorg/partiql/ast/Identifier;)V + public final fun setTable (Lorg/partiql/ast/Identifier;)V + public final fun table (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDdlDropIndexBuilder; +} + +public final class org/partiql/ast/builder/StatementDdlDropTableBuilder { public fun ()V - public fun (Lorg/partiql/ast/DdlOp;)V - public synthetic fun (Lorg/partiql/ast/DdlOp;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/Statement$DDL; - public final fun getOp ()Lorg/partiql/ast/DdlOp; - public final fun op (Lorg/partiql/ast/DdlOp;)Lorg/partiql/ast/builder/StatementDdlBuilder; - public final fun setOp (Lorg/partiql/ast/DdlOp;)V + public fun (Lorg/partiql/ast/Identifier;)V + public synthetic fun (Lorg/partiql/ast/Identifier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/Statement$DDL$DropTable; + public final fun getTable ()Lorg/partiql/ast/Identifier; + public final fun setTable (Lorg/partiql/ast/Identifier;)V + public final fun table (Lorg/partiql/ast/Identifier;)Lorg/partiql/ast/builder/StatementDdlDropTableBuilder; } public final class org/partiql/ast/builder/StatementDmlBatchLegacyBuilder { @@ -5947,52 +5719,63 @@ public final class org/partiql/ast/builder/StatementQueryBuilder { public final fun setExpr (Lorg/partiql/ast/Expr;)V } -public final class org/partiql/ast/builder/TableDefinitionAttributeBuilder { +public final class org/partiql/ast/builder/TableDefinitionBuilder { + public fun ()V + public fun (Ljava/util/List;)V + public synthetic fun (Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/TableDefinition; + public final fun columns (Ljava/util/List;)Lorg/partiql/ast/builder/TableDefinitionBuilder; + public final fun getColumns ()Ljava/util/List; + public final fun setColumns (Ljava/util/List;)V +} + +public final class org/partiql/ast/builder/TableDefinitionColumnBuilder { 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 final fun build ()Lorg/partiql/ast/TableDefinition$Attribute; - public final fun comment (Ljava/lang/String;)Lorg/partiql/ast/builder/TableDefinitionAttributeBuilder; - public final fun constraints (Ljava/util/List;)Lorg/partiql/ast/builder/TableDefinitionAttributeBuilder; - public final fun getComment ()Ljava/lang/String; + public fun (Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;)V + public synthetic fun (Ljava/lang/String;Lorg/partiql/ast/Type;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/TableDefinition$Column; + public final fun constraints (Ljava/util/List;)Lorg/partiql/ast/builder/TableDefinitionColumnBuilder; public final fun getConstraints ()Ljava/util/List; - public final fun getName ()Lorg/partiql/ast/Identifier$Symbol; + public final fun getName ()Ljava/lang/String; 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/TableDefinitionAttributeBuilder; - public final fun name (Lorg/partiql/ast/Identifier$Symbol;)Lorg/partiql/ast/builder/TableDefinitionAttributeBuilder; - public final fun setComment (Ljava/lang/String;)V + public final fun name (Ljava/lang/String;)Lorg/partiql/ast/builder/TableDefinitionColumnBuilder; public final fun setConstraints (Ljava/util/List;)V - public final fun setName (Lorg/partiql/ast/Identifier$Symbol;)V - public final fun setOptional (Ljava/lang/Boolean;)V + public final fun setName (Ljava/lang/String;)V public final fun setType (Lorg/partiql/ast/Type;)V - public final fun type (Lorg/partiql/ast/Type;)Lorg/partiql/ast/builder/TableDefinitionAttributeBuilder; + public final fun type (Lorg/partiql/ast/Type;)Lorg/partiql/ast/builder/TableDefinitionColumnBuilder; } -public final class org/partiql/ast/builder/TableDefinitionBuilder { +public final class org/partiql/ast/builder/TableDefinitionColumnConstraintBodyCheckBuilder { public fun ()V - public fun (Ljava/util/List;Ljava/util/List;)V - public synthetic fun (Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun attributes (Ljava/util/List;)Lorg/partiql/ast/builder/TableDefinitionBuilder; - public final fun build ()Lorg/partiql/ast/TableDefinition; - public final fun constraints (Ljava/util/List;)Lorg/partiql/ast/builder/TableDefinitionBuilder; - public final fun getAttributes ()Ljava/util/List; - public final fun getConstraints ()Ljava/util/List; - public final fun setAttributes (Ljava/util/List;)V - public final fun setConstraints (Ljava/util/List;)V + public fun (Lorg/partiql/ast/Expr;)V + public synthetic fun (Lorg/partiql/ast/Expr;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun build ()Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check; + public final fun expr (Lorg/partiql/ast/Expr;)Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBodyCheckBuilder; + public final fun getExpr ()Lorg/partiql/ast/Expr; + public final fun setExpr (Lorg/partiql/ast/Expr;)V +} + +public final class org/partiql/ast/builder/TableDefinitionColumnConstraintBodyNotNullBuilder { + public fun ()V + public final fun build ()Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull; +} + +public final class org/partiql/ast/builder/TableDefinitionColumnConstraintBodyNullableBuilder { + public fun ()V + public final fun build ()Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable; } -public final class org/partiql/ast/builder/TablePropertyBuilder { +public final class org/partiql/ast/builder/TableDefinitionColumnConstraintBuilder { public fun ()V - public fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValue;)V - public synthetic fun (Ljava/lang/String;Lorg/partiql/value/PartiQLValue;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/TableProperty; + public fun (Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;)V + public synthetic fun (Ljava/lang/String;Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun body (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;)Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBuilder; + public final fun build ()Lorg/partiql/ast/TableDefinition$Column$Constraint; + public final fun getBody ()Lorg/partiql/ast/TableDefinition$Column$Constraint$Body; public final fun getName ()Ljava/lang/String; - public final fun getValue ()Lorg/partiql/value/PartiQLValue; - public final fun name (Ljava/lang/String;)Lorg/partiql/ast/builder/TablePropertyBuilder; + public final fun name (Ljava/lang/String;)Lorg/partiql/ast/builder/TableDefinitionColumnConstraintBuilder; + public final fun setBody (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;)V public final fun setName (Ljava/lang/String;)V - public final fun setValue (Lorg/partiql/value/PartiQLValue;)V - public final fun value (Lorg/partiql/value/PartiQLValue;)Lorg/partiql/ast/builder/TablePropertyBuilder; } public final class org/partiql/ast/builder/TypeAnyBuilder { @@ -6000,16 +5783,6 @@ public final class org/partiql/ast/builder/TypeAnyBuilder { public final fun build ()Lorg/partiql/ast/Type$Any; } -public final class org/partiql/ast/builder/TypeArrayBuilder { - public fun ()V - public fun (Lorg/partiql/ast/Type;)V - public synthetic fun (Lorg/partiql/ast/Type;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun build ()Lorg/partiql/ast/Type$Array; - public final fun getType ()Lorg/partiql/ast/Type; - public final fun setType (Lorg/partiql/ast/Type;)V - public final fun type (Lorg/partiql/ast/Type;)Lorg/partiql/ast/builder/TypeArrayBuilder; -} - public final class org/partiql/ast/builder/TypeBagBuilder { public fun ()V public final fun build ()Lorg/partiql/ast/Type$Bag; @@ -6208,34 +5981,7 @@ public final class org/partiql/ast/builder/TypeStringBuilder { public final class org/partiql/ast/builder/TypeStructBuilder { public fun ()V - public fun (Ljava/util/List;)V - public synthetic fun (Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun build ()Lorg/partiql/ast/Type$Struct; - public final fun fields (Ljava/util/List;)Lorg/partiql/ast/builder/TypeStructBuilder; - public final fun getFields ()Ljava/util/List; - public final fun setFields (Ljava/util/List;)V -} - -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 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 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 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 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; } public final class org/partiql/ast/builder/TypeSymbolBuilder { @@ -6657,24 +6403,6 @@ 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 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; - public fun visitConstraintDefinitionCheck (Lorg/partiql/ast/Constraint$Definition$Check;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitConstraintDefinitionNotNull (Lorg/partiql/ast/Constraint$Definition$NotNull;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitConstraintDefinitionNotNull (Lorg/partiql/ast/Constraint$Definition$NotNull;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitConstraintDefinitionNullable (Lorg/partiql/ast/Constraint$Definition$Nullable;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitConstraintDefinitionNullable (Lorg/partiql/ast/Constraint$Definition$Nullable;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitConstraintDefinitionUnique (Lorg/partiql/ast/Constraint$Definition$Unique;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitConstraintDefinitionUnique (Lorg/partiql/ast/Constraint$Definition$Unique;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitDdlOpCreateIndex (Lorg/partiql/ast/DdlOp$CreateIndex;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpCreateIndex (Lorg/partiql/ast/DdlOp$CreateIndex;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitDdlOpCreateTable (Lorg/partiql/ast/DdlOp$CreateTable;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpCreateTable (Lorg/partiql/ast/DdlOp$CreateTable;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitDdlOpDropIndex (Lorg/partiql/ast/DdlOp$DropIndex;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpDropIndex (Lorg/partiql/ast/DdlOp$DropIndex;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitDdlOpDropTable (Lorg/partiql/ast/DdlOp$DropTable;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpDropTable (Lorg/partiql/ast/DdlOp$DropTable;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitExclude (Lorg/partiql/ast/Exclude;Ljava/lang/Object;)Ljava/lang/Object; public fun visitExclude (Lorg/partiql/ast/Exclude;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitExcludeItem (Lorg/partiql/ast/Exclude$Item;Ljava/lang/Object;)Ljava/lang/Object; @@ -6839,8 +6567,6 @@ public abstract class org/partiql/ast/util/AstRewriter : org/partiql/ast/visitor public fun visitOnConflictTargetSymbols (Lorg/partiql/ast/OnConflict$Target$Symbols;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitOrderBy (Lorg/partiql/ast/OrderBy;Ljava/lang/Object;)Ljava/lang/Object; public fun visitOrderBy (Lorg/partiql/ast/OrderBy;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitPartitionByAttrList (Lorg/partiql/ast/PartitionBy$AttrList;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitPartitionByAttrList (Lorg/partiql/ast/PartitionBy$AttrList;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitPath (Lorg/partiql/ast/Path;Ljava/lang/Object;)Ljava/lang/Object; public fun visitPath (Lorg/partiql/ast/Path;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitPathStepIndex (Lorg/partiql/ast/Path$Step$Index;Ljava/lang/Object;)Ljava/lang/Object; @@ -6871,8 +6597,14 @@ public abstract class org/partiql/ast/util/AstRewriter : org/partiql/ast/visitor public fun visitSetOp (Lorg/partiql/ast/SetOp;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitSort (Lorg/partiql/ast/Sort;Ljava/lang/Object;)Ljava/lang/Object; public fun visitSort (Lorg/partiql/ast/Sort;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitStatementDDL (Lorg/partiql/ast/Statement$DDL;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitStatementDDL (Lorg/partiql/ast/Statement$DDL;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitStatementDDLCreateIndex (Lorg/partiql/ast/Statement$DDL$CreateIndex;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLCreateIndex (Lorg/partiql/ast/Statement$DDL$CreateIndex;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitStatementDDLCreateTable (Lorg/partiql/ast/Statement$DDL$CreateTable;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLCreateTable (Lorg/partiql/ast/Statement$DDL$CreateTable;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitStatementDDLDropIndex (Lorg/partiql/ast/Statement$DDL$DropIndex;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLDropIndex (Lorg/partiql/ast/Statement$DDL$DropIndex;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitStatementDDLDropTable (Lorg/partiql/ast/Statement$DDL$DropTable;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLDropTable (Lorg/partiql/ast/Statement$DDL$DropTable;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitStatementDMLBatchLegacy (Lorg/partiql/ast/Statement$DML$BatchLegacy;Ljava/lang/Object;)Ljava/lang/Object; public fun visitStatementDMLBatchLegacy (Lorg/partiql/ast/Statement$DML$BatchLegacy;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitStatementDMLBatchLegacyOpDelete (Lorg/partiql/ast/Statement$DML$BatchLegacy$Op$Delete;Ljava/lang/Object;)Ljava/lang/Object; @@ -6913,14 +6645,18 @@ public abstract class org/partiql/ast/util/AstRewriter : org/partiql/ast/visitor public fun visitStatementQuery (Lorg/partiql/ast/Statement$Query;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitTableDefinition (Lorg/partiql/ast/TableDefinition;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTableDefinition (Lorg/partiql/ast/TableDefinition;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitTableDefinitionAttribute (Lorg/partiql/ast/TableDefinition$Attribute;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTableDefinitionAttribute (Lorg/partiql/ast/TableDefinition$Attribute;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitTableProperty (Lorg/partiql/ast/TableProperty;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTableProperty (Lorg/partiql/ast/TableProperty;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitTableDefinitionColumn (Lorg/partiql/ast/TableDefinition$Column;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumn (Lorg/partiql/ast/TableDefinition$Column;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitTableDefinitionColumnConstraint (Lorg/partiql/ast/TableDefinition$Column$Constraint;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraint (Lorg/partiql/ast/TableDefinition$Column$Constraint;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitTableDefinitionColumnConstraintBodyCheck (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraintBodyCheck (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitTableDefinitionColumnConstraintBodyNotNull (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraintBodyNotNull (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; + public synthetic fun visitTableDefinitionColumnConstraintBodyNullable (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraintBodyNullable (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitTypeAny (Lorg/partiql/ast/Type$Any;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeAny (Lorg/partiql/ast/Type$Any;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitTypeArray (Lorg/partiql/ast/Type$Array;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTypeArray (Lorg/partiql/ast/Type$Array;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitTypeBag (Lorg/partiql/ast/Type$Bag;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeBag (Lorg/partiql/ast/Type$Bag;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitTypeBigint (Lorg/partiql/ast/Type$Bigint;Ljava/lang/Object;)Ljava/lang/Object; @@ -6977,8 +6713,6 @@ public abstract class org/partiql/ast/util/AstRewriter : org/partiql/ast/visitor public fun visitTypeString (Lorg/partiql/ast/Type$String;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitTypeStruct (Lorg/partiql/ast/Type$Struct;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeStruct (Lorg/partiql/ast/Type$Struct;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; - public synthetic fun visitTypeStructField (Lorg/partiql/ast/Type$Struct$Field;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTypeStructField (Lorg/partiql/ast/Type$Struct$Field;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitTypeSymbol (Lorg/partiql/ast/Type$Symbol;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeSymbol (Lorg/partiql/ast/Type$Symbol;Ljava/lang/Object;)Lorg/partiql/ast/AstNode; public synthetic fun visitTypeTime (Lorg/partiql/ast/Type$Time;Ljava/lang/Object;)Ljava/lang/Object; @@ -7002,17 +6736,6 @@ 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 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; - public fun visitConstraintDefinitionNotNull (Lorg/partiql/ast/Constraint$Definition$NotNull;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitConstraintDefinitionNullable (Lorg/partiql/ast/Constraint$Definition$Nullable;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitConstraintDefinitionUnique (Lorg/partiql/ast/Constraint$Definition$Unique;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOp (Lorg/partiql/ast/DdlOp;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpCreateIndex (Lorg/partiql/ast/DdlOp$CreateIndex;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpCreateTable (Lorg/partiql/ast/DdlOp$CreateTable;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpDropIndex (Lorg/partiql/ast/DdlOp$DropIndex;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitDdlOpDropTable (Lorg/partiql/ast/DdlOp$DropTable;Ljava/lang/Object;)Ljava/lang/Object; public fun visitExclude (Lorg/partiql/ast/Exclude;Ljava/lang/Object;)Ljava/lang/Object; public fun visitExcludeItem (Lorg/partiql/ast/Exclude$Item;Ljava/lang/Object;)Ljava/lang/Object; public fun visitExcludeStep (Lorg/partiql/ast/Exclude$Step;Ljava/lang/Object;)Ljava/lang/Object; @@ -7105,8 +6828,6 @@ public abstract class org/partiql/ast/visitor/AstBaseVisitor : org/partiql/ast/v public fun visitOnConflictTargetConstraint (Lorg/partiql/ast/OnConflict$Target$Constraint;Ljava/lang/Object;)Ljava/lang/Object; public fun visitOnConflictTargetSymbols (Lorg/partiql/ast/OnConflict$Target$Symbols;Ljava/lang/Object;)Ljava/lang/Object; public fun visitOrderBy (Lorg/partiql/ast/OrderBy;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitPartitionBy (Lorg/partiql/ast/PartitionBy;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitPartitionByAttrList (Lorg/partiql/ast/PartitionBy$AttrList;Ljava/lang/Object;)Ljava/lang/Object; public fun visitPath (Lorg/partiql/ast/Path;Ljava/lang/Object;)Ljava/lang/Object; public fun visitPathStep (Lorg/partiql/ast/Path$Step;Ljava/lang/Object;)Ljava/lang/Object; public fun visitPathStepIndex (Lorg/partiql/ast/Path$Step$Index;Ljava/lang/Object;)Ljava/lang/Object; @@ -7128,6 +6849,10 @@ public abstract class org/partiql/ast/visitor/AstBaseVisitor : org/partiql/ast/v public fun visitSort (Lorg/partiql/ast/Sort;Ljava/lang/Object;)Ljava/lang/Object; public fun visitStatement (Lorg/partiql/ast/Statement;Ljava/lang/Object;)Ljava/lang/Object; public fun visitStatementDDL (Lorg/partiql/ast/Statement$DDL;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLCreateIndex (Lorg/partiql/ast/Statement$DDL$CreateIndex;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLCreateTable (Lorg/partiql/ast/Statement$DDL$CreateTable;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLDropIndex (Lorg/partiql/ast/Statement$DDL$DropIndex;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitStatementDDLDropTable (Lorg/partiql/ast/Statement$DDL$DropTable;Ljava/lang/Object;)Ljava/lang/Object; public fun visitStatementDML (Lorg/partiql/ast/Statement$DML;Ljava/lang/Object;)Ljava/lang/Object; public fun visitStatementDMLBatchLegacy (Lorg/partiql/ast/Statement$DML$BatchLegacy;Ljava/lang/Object;)Ljava/lang/Object; public fun visitStatementDMLBatchLegacyOp (Lorg/partiql/ast/Statement$DML$BatchLegacy$Op;Ljava/lang/Object;)Ljava/lang/Object; @@ -7151,11 +6876,14 @@ public abstract class org/partiql/ast/visitor/AstBaseVisitor : org/partiql/ast/v public fun visitStatementExplainTargetDomain (Lorg/partiql/ast/Statement$Explain$Target$Domain;Ljava/lang/Object;)Ljava/lang/Object; public fun visitStatementQuery (Lorg/partiql/ast/Statement$Query;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTableDefinition (Lorg/partiql/ast/TableDefinition;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTableDefinitionAttribute (Lorg/partiql/ast/TableDefinition$Attribute;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTableProperty (Lorg/partiql/ast/TableProperty;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumn (Lorg/partiql/ast/TableDefinition$Column;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraint (Lorg/partiql/ast/TableDefinition$Column$Constraint;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraintBody (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraintBodyCheck (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraintBodyNotNull (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull;Ljava/lang/Object;)Ljava/lang/Object; + public fun visitTableDefinitionColumnConstraintBodyNullable (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable;Ljava/lang/Object;)Ljava/lang/Object; public fun visitType (Lorg/partiql/ast/Type;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeAny (Lorg/partiql/ast/Type$Any;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTypeArray (Lorg/partiql/ast/Type$Array;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeBag (Lorg/partiql/ast/Type$Bag;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeBigint (Lorg/partiql/ast/Type$Bigint;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeBit (Lorg/partiql/ast/Type$Bit;Ljava/lang/Object;)Ljava/lang/Object; @@ -7184,7 +6912,6 @@ public abstract class org/partiql/ast/visitor/AstBaseVisitor : org/partiql/ast/v public fun visitTypeSmallint (Lorg/partiql/ast/Type$Smallint;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeString (Lorg/partiql/ast/Type$String;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeStruct (Lorg/partiql/ast/Type$Struct;Ljava/lang/Object;)Ljava/lang/Object; - public fun visitTypeStructField (Lorg/partiql/ast/Type$Struct$Field;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeSymbol (Lorg/partiql/ast/Type$Symbol;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeTime (Lorg/partiql/ast/Type$Time;Ljava/lang/Object;)Ljava/lang/Object; public fun visitTypeTimeWithTz (Lorg/partiql/ast/Type$TimeWithTz;Ljava/lang/Object;)Ljava/lang/Object; @@ -7197,17 +6924,6 @@ 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 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; - public abstract fun visitConstraintDefinitionNotNull (Lorg/partiql/ast/Constraint$Definition$NotNull;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitConstraintDefinitionNullable (Lorg/partiql/ast/Constraint$Definition$Nullable;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitConstraintDefinitionUnique (Lorg/partiql/ast/Constraint$Definition$Unique;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitDdlOp (Lorg/partiql/ast/DdlOp;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitDdlOpCreateIndex (Lorg/partiql/ast/DdlOp$CreateIndex;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitDdlOpCreateTable (Lorg/partiql/ast/DdlOp$CreateTable;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitDdlOpDropIndex (Lorg/partiql/ast/DdlOp$DropIndex;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitDdlOpDropTable (Lorg/partiql/ast/DdlOp$DropTable;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitExclude (Lorg/partiql/ast/Exclude;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitExcludeItem (Lorg/partiql/ast/Exclude$Item;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitExcludeStep (Lorg/partiql/ast/Exclude$Step;Ljava/lang/Object;)Ljava/lang/Object; @@ -7300,8 +7016,6 @@ public abstract interface class org/partiql/ast/visitor/AstVisitor { public abstract fun visitOnConflictTargetConstraint (Lorg/partiql/ast/OnConflict$Target$Constraint;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitOnConflictTargetSymbols (Lorg/partiql/ast/OnConflict$Target$Symbols;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitOrderBy (Lorg/partiql/ast/OrderBy;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitPartitionBy (Lorg/partiql/ast/PartitionBy;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitPartitionByAttrList (Lorg/partiql/ast/PartitionBy$AttrList;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitPath (Lorg/partiql/ast/Path;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitPathStep (Lorg/partiql/ast/Path$Step;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitPathStepIndex (Lorg/partiql/ast/Path$Step$Index;Ljava/lang/Object;)Ljava/lang/Object; @@ -7323,6 +7037,10 @@ public abstract interface class org/partiql/ast/visitor/AstVisitor { public abstract fun visitSort (Lorg/partiql/ast/Sort;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitStatement (Lorg/partiql/ast/Statement;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitStatementDDL (Lorg/partiql/ast/Statement$DDL;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitStatementDDLCreateIndex (Lorg/partiql/ast/Statement$DDL$CreateIndex;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitStatementDDLCreateTable (Lorg/partiql/ast/Statement$DDL$CreateTable;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitStatementDDLDropIndex (Lorg/partiql/ast/Statement$DDL$DropIndex;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitStatementDDLDropTable (Lorg/partiql/ast/Statement$DDL$DropTable;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitStatementDML (Lorg/partiql/ast/Statement$DML;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitStatementDMLBatchLegacy (Lorg/partiql/ast/Statement$DML$BatchLegacy;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitStatementDMLBatchLegacyOp (Lorg/partiql/ast/Statement$DML$BatchLegacy$Op;Ljava/lang/Object;)Ljava/lang/Object; @@ -7346,11 +7064,14 @@ public abstract interface class org/partiql/ast/visitor/AstVisitor { public abstract fun visitStatementExplainTargetDomain (Lorg/partiql/ast/Statement$Explain$Target$Domain;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitStatementQuery (Lorg/partiql/ast/Statement$Query;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTableDefinition (Lorg/partiql/ast/TableDefinition;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitTableDefinitionAttribute (Lorg/partiql/ast/TableDefinition$Attribute;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitTableProperty (Lorg/partiql/ast/TableProperty;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitTableDefinitionColumn (Lorg/partiql/ast/TableDefinition$Column;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitTableDefinitionColumnConstraint (Lorg/partiql/ast/TableDefinition$Column$Constraint;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitTableDefinitionColumnConstraintBody (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitTableDefinitionColumnConstraintBodyCheck (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Check;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitTableDefinitionColumnConstraintBodyNotNull (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$NotNull;Ljava/lang/Object;)Ljava/lang/Object; + public abstract fun visitTableDefinitionColumnConstraintBodyNullable (Lorg/partiql/ast/TableDefinition$Column$Constraint$Body$Nullable;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitType (Lorg/partiql/ast/Type;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeAny (Lorg/partiql/ast/Type$Any;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitTypeArray (Lorg/partiql/ast/Type$Array;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeBag (Lorg/partiql/ast/Type$Bag;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeBigint (Lorg/partiql/ast/Type$Bigint;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeBit (Lorg/partiql/ast/Type$Bit;Ljava/lang/Object;)Ljava/lang/Object; @@ -7379,7 +7100,6 @@ public abstract interface class org/partiql/ast/visitor/AstVisitor { public abstract fun visitTypeSmallint (Lorg/partiql/ast/Type$Smallint;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeString (Lorg/partiql/ast/Type$String;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeStruct (Lorg/partiql/ast/Type$Struct;Ljava/lang/Object;)Ljava/lang/Object; - public abstract fun visitTypeStructField (Lorg/partiql/ast/Type$Struct$Field;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeSymbol (Lorg/partiql/ast/Type$Symbol;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeTime (Lorg/partiql/ast/Type$Time;Ljava/lang/Object;)Ljava/lang/Object; public abstract fun visitTypeTimeWithTz (Lorg/partiql/ast/Type$TimeWithTz;Ljava/lang/Object;)Ljava/lang/Object; diff --git a/partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToLegacyAst.kt b/partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToLegacyAst.kt index cd25a2fde..dd1b84f43 100644 --- a/partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToLegacyAst.kt +++ b/partiql-ast/src/main/kotlin/org/partiql/ast/helpers/ToLegacyAst.kt @@ -16,9 +16,7 @@ import com.amazon.ionelement.api.ionString import com.amazon.ionelement.api.ionSymbol import com.amazon.ionelement.api.metaContainerOf import org.partiql.ast.AstNode -import org.partiql.ast.Constraint import org.partiql.ast.DatetimeField -import org.partiql.ast.DdlOp import org.partiql.ast.Exclude import org.partiql.ast.Expr import org.partiql.ast.From @@ -125,29 +123,24 @@ private class AstTranslator(val metas: Map) : AstBaseVisi domain(statement, type, format, metas) } - override fun visitStatementDDL(node: Statement.DDL, ctx: Ctx) = when (val op = node.op) { - is DdlOp.CreateIndex -> visitDdlOpCreateIndex(op, ctx) - is DdlOp.CreateTable -> visitDdlOpCreateTable(op, ctx) - is DdlOp.DropIndex -> visitDdlOpDropIndex(op, ctx) - is DdlOp.DropTable -> visitDdlOpDropTable(op, ctx) - } + override fun visitStatementDDL(node: Statement.DDL, ctx: Ctx) = super.visit(node, ctx) as PartiqlAst.Statement.Ddl - override fun visitDdlOpCreateTable(node: DdlOp.CreateTable, ctx: Ctx) = translate(node) { metas -> + override fun visitStatementDDLCreateTable( + node: Statement.DDL.CreateTable, + ctx: Ctx, + ) = translate(node) { metas -> if (node.name !is Identifier.Symbol) { error("The legacy AST does not support qualified identifiers as table names") } - val tableName = node.name.symbol + val tableName = (node.name as Identifier.Symbol).symbol val def = node.definition?.let { visitTableDefinition(it, ctx) } - if (node.partitionBy != null) { - error("The legacy AST does not support Partition BY in create Table") - } - if (node.tableProperties.isNotEmpty()) { - error("The legacy AST does not support TBLProperties in create Table") - } ddl(createTable(tableName, def), metas) } - override fun visitDdlOpCreateIndex(node: DdlOp.CreateIndex, ctx: Ctx) = translate(node) { metas -> + override fun visitStatementDDLCreateIndex( + node: Statement.DDL.CreateIndex, + ctx: Ctx, + ) = translate(node) { metas -> if (node.index != null) { error("The legacy AST does not support index names") } @@ -159,7 +152,7 @@ private class AstTranslator(val metas: Map) : AstBaseVisi ddl(createIndex(tableName, fields), metas) } - override fun visitDdlOpDropTable(node: DdlOp.DropTable, ctx: Ctx) = translate(node) { metas -> + override fun visitStatementDDLDropTable(node: Statement.DDL.DropTable, ctx: Ctx) = translate(node) { metas -> if (node.table !is Identifier.Symbol) { error("The legacy AST does not support qualified identifiers as table names") } @@ -168,7 +161,7 @@ private class AstTranslator(val metas: Map) : AstBaseVisi ddl(dropTable(tableName), metas) } - override fun visitDdlOpDropIndex(node: DdlOp.DropIndex, ctx: Ctx) = translate(node) { metas -> + override fun visitStatementDDLDropIndex(node: Statement.DDL.DropIndex, ctx: Ctx) = translate(node) { metas -> if (node.index !is Identifier.Symbol) { error("The legacy AST does not support qualified identifiers as index names") } @@ -183,34 +176,28 @@ private class AstTranslator(val metas: Map) : AstBaseVisi } override fun visitTableDefinition(node: TableDefinition, ctx: Ctx) = translate(node) { metas -> - val parts = node.attributes.translate(ctx) - if (node.constraints.isNotEmpty()) { - error("The legacy AST does not support table level constraint declaration") - } + val parts = node.columns.translate(ctx) tableDef(parts, metas) } - override fun visitTableDefinitionAttribute(node: TableDefinition.Attribute, ctx: Ctx) = translate(node) { metas -> - // Legacy AST treat table name as a case-sensitive string - val name = node.name.symbol + override fun visitTableDefinitionColumn(node: TableDefinition.Column, ctx: Ctx) = translate(node) { metas -> + val name = node.name val type = visitType(node.type, ctx) val constraints = node.constraints.translate(ctx) - if (node.isOptional) { - error("The legacy AST does not support optional field declaration") - } - if (node.comment != null) { - error("The legacy AST does not support comment clause") - } columnDeclaration(name, type, constraints, metas) } - override fun visitConstraint(node: Constraint, ctx: Ctx) = translate(node) { + override fun visitTableDefinitionColumnConstraint( + node: TableDefinition.Column.Constraint, + ctx: Ctx, + ) = translate(node) { metas -> val name = node.name - val def = when (node.definition) { - is Constraint.Definition.Check -> throw IllegalArgumentException("PIG AST does not support CHECK () constraint") - is Constraint.Definition.NotNull -> columnNotnull() - is Constraint.Definition.Nullable -> columnNull() - is Constraint.Definition.Unique -> throw IllegalArgumentException("PIG AST does not support Unique/Primary Key constraint") + val def = when (node.body) { + is TableDefinition.Column.Constraint.Body.Check -> { + throw IllegalArgumentException("PIG AST does not support CHECK () constraint") + } + is TableDefinition.Column.Constraint.Body.NotNull -> columnNotnull() + is TableDefinition.Column.Constraint.Body.Nullable -> columnNull() } columnConstraint(name, def, metas) } @@ -1379,22 +1366,11 @@ private class AstTranslator(val metas: Map) : AstBaseVisi override fun visitTypeList(node: Type.List, ctx: Ctx) = translate(node) { metas -> listType(metas) } - override fun visitTypeArray(node: Type.Array, ctx: Ctx) = translate(node) { metas -> - if (node.type != null) { - error("The legacy AST does not support element type declaration for list") - } - listType(metas) - } override fun visitTypeSexp(node: Type.Sexp, ctx: Ctx) = translate(node) { metas -> sexpType(metas) } override fun visitTypeTuple(node: Type.Tuple, ctx: Ctx) = translate(node) { metas -> tupleType(metas) } - override fun visitTypeStruct(node: Type.Struct, ctx: Ctx) = translate(node) { metas -> - if (node.fields.isNotEmpty()) { - error("The legacy AST does not support field declaration in struct type") - } - structType(metas) - } + override fun visitTypeStruct(node: Type.Struct, ctx: Ctx) = translate(node) { metas -> structType(metas) } override fun visitTypeAny(node: Type.Any, ctx: Ctx) = translate(node) { metas -> anyType(metas) } 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 97917bb9a..225a35939 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 @@ -201,13 +201,10 @@ internal abstract class InternalSqlDialect : AstBaseVisitor [] + create_table::{ + name: identifier, + definition: optional::table_definition, + }, + + // CREATE INDEX [] ON ( [, ]...) + create_index::{ + index: optional::identifier, + table: identifier, + fields: list::[path], + }, + + // DROP TABLE + drop_table::{ + table: identifier, + }, + + // DROP INDEX ON + drop_index::{ + index: identifier, // [0] + table: identifier, // [1] + }, + ], // EXEC [.*] exec::{ @@ -128,38 +151,6 @@ statement::[ }, ] -ddl_op::[ - // CREATE TABLE [] - create_table::{ - name: identifier, - definition: optional::table_definition, - // This is an expression for backward compatibility - // For now, we support `PARTITION BY ( (, )* ))` - // But in the future, we might support additional partition expressions: - // such as `PARTITION BY RANGE(..)` - partition_by: optional::partition_by, - table_properties: list::[table_property], - }, - - // CREATE INDEX [] ON ( [, ]...) - create_index::{ - index: optional::identifier, - table: identifier, - fields: list::[path], - }, - - // DROP TABLE - drop_table::{ - table: identifier, - }, - - // DROP INDEX ON - drop_index::{ - index: identifier, // [0] - table: identifier, // [1] - }, -] - // PartiQL Type AST nodes // // Several of these are the same "type", but have various syntax rules we wish to capture. @@ -202,48 +193,10 @@ type::[ timestamp_with_tz::{ precision: optional::int }, // TIMESTAMP [()] WITH TIMEZONE interval::{ precision: optional::int }, // INTERVAL bag::{}, // BAG - // Potential migration strategy: - // v0.14.x -- the current state in `main` - // typeList() - // - // v0.15.x -- the next release - // @Deprecated // recommend using `typeArray()` - // typeList() - // typeArray(...) - // - // v1.0.x - // typeArray(...) // `typeList` now deleted list::{}, // LIST - array::{ type: optional::type }, // ARRAY [] sexp::{}, // SEXP - // Potential migration strategy: - // v0.14.x -- the current state in `main` - // typeTuple() - // typeStruct() - // - // v0.15.x -- the next release - // @Deprecated // recommend using `typeStruct` - // typeTuple() - // typeStruct(fields = ...) - // - // v1.0.x - // typeStruct(fields = ...) // `typeTuple` now deleted tuple::{}, // TUPLE - struct::{ - fields: list::[field], - _ : [ - field :: { - name: '.identifier.symbol', - 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 - // to prevent future breaking changes. - constraints: list::[constraint], - is_optional: bool, - comment: optional::string, - } - ], - }, // STRUCT + struct::{}, // STRUCT any::{}, // ANY custom::{ name: string }, // ] @@ -829,48 +782,31 @@ returning::{ ], } +// ` *` +// `( CONSTRAINT )? ` table_definition::{ - attributes: list::[attribute], - // table level constraints - constraints: list::[constraint], + columns: list::[column], _: [ - attribute::{ - name: '.identifier.symbol', + column::{ + name: string, type: '.type', constraints: list::[constraint], - // TODO: Consider to model this as a constraint? - is_optional: bool, - comment: optional::string, - } - ], -} - -constraint::{ - name: optional::string, - definition: [ - nullable::{}, - not_null::{}, - check::{ expr: expr }, - unique::{ - // for attribute level constraint, we can set this attribute to null - attributes: optional::list::['.identifier.symbol'], - is_primary_key: bool, + _: [ + // TODO improve modeling language to avoid these wrapped unions + // Also, prefer not to nest more than twice + constraint::{ + name: optional::string, + body: [ + nullable::{}, + not_null::{}, + check::{ expr: expr }, + ], + }, + ], }, ], } -partition_by::[ - attr_list :: { - list: list::['.identifier.symbol'] - }, - // We can add other commonly support Partition Expression like `range` later -] - -table_property::{ - name: string, - value: '.value', -} - // SQL-99 Table 11 datetime_field::[ YEAR, // 0001-9999 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 8cfc7ae61..11f6b937c 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 @@ -407,31 +407,15 @@ class ToLegacyAstTest { expect("(struct_type)") { typeStruct() }, expect("(tuple_type)") { typeTuple() }, expect("(list_type)") { typeList() }, - expect("(list_type)") { typeArray(null) }, expect("(sexp_type)") { typeSexp() }, expect("(bag_type)") { typeBag() }, expect("(any_type)") { typeAny() }, // Other (??) expect("(integer4_type)") { typeInt4() }, expect("(integer8_type)") { typeInt8() }, - expect("(custom_type dog)") { typeCustom("dog") }, + expect("(custom_type dog)") { typeCustom("dog") } // LEGACY AST does not have TIMESTAMP or INTERVAL // LEGACY AST does not have parameterized blob/clob - // LEGACY AST does not support struct with field declaration - 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), - typeInt2(), - emptyList(), - false, - null - ) - } - }, - fail("The legacy AST does not support element type declaration for list") { - typeArray(typeInt2()) - }, ) @JvmStatic diff --git a/partiql-lang/src/main/kotlin/org/partiql/lang/syntax/impl/PartiQLPigVisitor.kt b/partiql-lang/src/main/kotlin/org/partiql/lang/syntax/impl/PartiQLPigVisitor.kt index 94fc44234..8b46c2aa1 100644 --- a/partiql-lang/src/main/kotlin/org/partiql/lang/syntax/impl/PartiQLPigVisitor.kt +++ b/partiql-lang/src/main/kotlin/org/partiql/lang/syntax/impl/PartiQLPigVisitor.kt @@ -259,7 +259,6 @@ internal class PartiQLPigVisitor( throw ParserException("PIG Parser does not support qualified name as table name", ErrorCode.PARSE_UNEXPECTED_TOKEN) } val def = ctx.tableDef()?.let { visitTableDef(it) } - ctx.tableExtension().map { visit(it) } createTable_(name, def, ctx.CREATE().getSourceMetaContainer()) } @@ -278,17 +277,11 @@ internal class PartiQLPigVisitor( val name = visitSymbolPrimitive(ctx.columnName().symbolPrimitive()).name.text val type = visit(ctx.type()) as PartiqlAst.Type val constrs = ctx.columnConstraint().map { visitColumnConstraint(it) } - if (ctx.OPTIONAL() != null) { - throw ParserException("PIG Parser does not support OPTIONAL Field", ErrorCode.PARSE_UNEXPECTED_TOKEN) - } - if (ctx.comment() != null) { - throw ParserException("PIG Parser does not support COMMENT Clause", ErrorCode.PARSE_UNEXPECTED_TOKEN) - } columnDeclaration(name, type, constrs) } override fun visitColumnConstraint(ctx: PartiQLParser.ColumnConstraintContext) = PartiqlAst.build { - val name = ctx.constraintName()?.let { visitSymbolPrimitive(it.symbolPrimitive()).name.text } + val name = ctx.columnConstraintName()?.let { visitSymbolPrimitive(it.symbolPrimitive()).name.text } val def = visit(ctx.columnConstraintDef()) as PartiqlAst.ColumnConstraintDef columnConstraint(name, def) } @@ -301,12 +294,6 @@ internal class PartiQLPigVisitor( columnNull() } - override fun visitTableConstrDeclaration(ctx: PartiQLParser.TableConstrDeclarationContext) = throw ParserException("PIG Parser does not support tuple level constraint", ErrorCode.PARSE_UNEXPECTED_TOKEN) - - override fun visitTblExtensionPartition(ctx: PartiQLParser.TblExtensionPartitionContext) = throw ParserException("PIG Parser does not support PARTITION BY Clause", ErrorCode.PARSE_UNEXPECTED_TOKEN) - - override fun visitTblExtensionTblProperties(ctx: PartiQLParser.TblExtensionTblPropertiesContext) = throw ParserException("PIG Parser does not support TBLPROPERTIES Clause", ErrorCode.PARSE_UNEXPECTED_TOKEN) - /** * * EXECUTE @@ -1661,6 +1648,9 @@ internal class PartiQLPigVisitor( PartiQLParser.BLOB -> blobType(metas) PartiQLParser.CLOB -> clobType(metas) PartiQLParser.DATE -> dateType(metas) + PartiQLParser.STRUCT -> structType(metas) + PartiQLParser.TUPLE -> tupleType(metas) + PartiQLParser.LIST -> listType(metas) PartiQLParser.BAG -> bagType(metas) PartiQLParser.SEXP -> sexpType(metas) PartiQLParser.ANY -> anyType(metas) @@ -1726,32 +1716,6 @@ internal class PartiQLPigVisitor( customType_(SymbolPrimitive(customName, metas), metas) } - override fun visitTypeComplexUnparameterized(ctx: PartiQLParser.TypeComplexUnparameterizedContext) = PartiqlAst.build { - val metas = ctx.datatype.getSourceMetaContainer() - when (ctx.datatype.type) { - PartiQLParser.TUPLE -> tupleType(metas) - PartiQLParser.STRUCT -> structType(metas) - PartiQLParser.ARRAY, PartiQLParser.LIST -> listType(metas) - else -> throw ParserException("Unknown datatype", ErrorCode.PARSE_UNEXPECTED_TOKEN, PropertyValueMap()) - } - } - - override fun visitTypeStruct(ctx: PartiQLParser.TypeStructContext) = PartiqlAst.build { - throw ParserException( - "PIG Parser does not support struct type with field declaration", - ErrorCode.PARSE_UNEXPECTED_TOKEN, - PropertyValueMap() - ) - } - - override fun visitTypeList(ctx: PartiQLParser.TypeListContext): PartiqlAst.PartiqlAstNode { - throw ParserException( - "PIG Parser does not support element type declaration for list", - ErrorCode.PARSE_UNEXPECTED_TOKEN, - PropertyValueMap() - ) - } - /** * * HELPER METHODS diff --git a/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserDDLTest.kt b/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserDDLTest.kt index 266203447..8bdba4c8f 100644 --- a/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserDDLTest.kt +++ b/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserDDLTest.kt @@ -35,139 +35,7 @@ internal class PartiQLParserDDLTest : PartiQLParserTestBase() { query = "DROP Table foo.bar", code = ErrorCode.PARSE_UNEXPECTED_TOKEN, context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support Unique Constraints in CREATE TABLE", - query = """ - CREATE TABLE tbl ( - a INT2 UNIQUE - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support Primary Key Constraint in CREATE TABLE", - query = """ - CREATE TABLE tbl ( - a INT2 PRIMARY KEY - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support CHECK Constraint in CREATE TABLE", - query = """ - CREATE TABLE tbl ( - a INT2 CHECK(a > 0) - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support table constraint in CREATE TABLE", - query = """ - CREATE TABLE tbl ( - check (a > 0) - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support Struct Type with field declaration", - query = """ - CREATE TABLE tbl ( - a STRUCT - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support element type declaration in Array Type", - query = """ - CREATE TABLE tbl ( - a ARRAY - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support OPTIONAL Attribute", - query = """ - CREATE TABLE tbl ( - a OPTIONAL INT2 - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support COMMENT keyword", - query = """ - CREATE TABLE tbl ( - a INT2 COMMENT 'this is a comment' - ) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support PARTITION BY keyword", - query = """ - CREATE TABLE tbl - PARTITION BY (a, b) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support TBLPROPERTIES keyword", - query = """ - CREATE TABLE tbl - TBLPROPERTIES ('k1' = 'v1') - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - - // Putting those tests here are they are impacted by DDL implementation - ParserErrorTestCase( - description = "PIG Parser does not support Struct Type with field declaration -- IS operator", - query = """ - a IS STRUCT - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support Struct Type with field declaration -- CAST operator", - query = """ - CAST(a AS STRUCT) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support element type declaration in Array Type -- IS operator", - query = """ - a IS ARRAY - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), - ParserErrorTestCase( - description = "PIG Parser does not support element type declaration in Array Type -- cast operator", - query = """ - CAST(a AS ARRAY) - """.trimIndent(), - code = ErrorCode.PARSE_UNEXPECTED_TOKEN, - context = mapOf(), - ), + ) ) } } diff --git a/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserMatchTest.kt b/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserMatchTest.kt index fcc1a10e2..d45c4a4fb 100644 --- a/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserMatchTest.kt +++ b/partiql-lang/src/test/kotlin/org/partiql/lang/syntax/PartiQLParserMatchTest.kt @@ -1067,7 +1067,7 @@ class PartiQLParserMatchTest : PartiQLParserTestBase() { @Test fun prefilters() = assertExpression( - "SELECT u as banCandidate FROM g MATCH (p:Post Where p.isFlagged = true) <-[:createdPost]- (u:Usr WHERE u.isBanned = false AND u.karma < 20) -[:createdComment]->(c:\"Comment\" WHERE c.isFlagged = true) WHERE p.title LIKE '%considered harmful%'", + "SELECT u as banCandidate FROM g MATCH (p:Post Where p.isFlagged = true) <-[:createdPost]- (u:Usr WHERE u.isBanned = false AND u.karma < 20) -[:createdComment]->(c:Comment WHERE c.isFlagged = true) WHERE p.title LIKE '%considered harmful%'", ) { PartiqlAst.build { select( diff --git a/partiql-parser/src/main/antlr/PartiQLParser.g4 b/partiql-parser/src/main/antlr/PartiQLParser.g4 index 54be03c23..6f70cdeda 100644 --- a/partiql-parser/src/main/antlr/PartiQLParser.g4 +++ b/partiql-parser/src/main/antlr/PartiQLParser.g4 @@ -77,9 +77,9 @@ execCommand qualifiedName : (qualifier+=symbolPrimitive PERIOD)* name=symbolPrimitive; tableName : symbolPrimitive; +tableConstraintName : symbolPrimitive; columnName : symbolPrimitive; -constraintName : symbolPrimitive; -comment : COMMENT LITERAL_STRING; +columnConstraintName : symbolPrimitive; ddl : createCommand @@ -87,7 +87,7 @@ ddl ; createCommand - : CREATE TABLE qualifiedName ( PAREN_LEFT tableDef PAREN_RIGHT )? tableExtension* # CreateTable + : CREATE TABLE qualifiedName ( PAREN_LEFT tableDef PAREN_RIGHT )? # CreateTable | CREATE INDEX ON symbolPrimitive PAREN_LEFT pathSimple ( COMMA pathSimple )* PAREN_RIGHT # CreateIndex ; @@ -101,58 +101,18 @@ tableDef ; tableDefPart - : columnName OPTIONAL? type columnConstraint* comment? # ColumnDeclaration - | ( CONSTRAINT constraintName )? tableConstraintDef # TableConstrDeclaration - ; - -tableConstraintDef - : checkConstraintDef # TableConstrCheck - | uniqueConstraintDef # TableConstrUnique + : columnName type columnConstraint* # ColumnDeclaration ; columnConstraint - : ( CONSTRAINT constraintName )? columnConstraintDef + : ( CONSTRAINT columnConstraintName )? columnConstraintDef ; columnConstraintDef - : NOT NULL # ColConstrNotNull - | NULL # ColConstrNull - | uniqueSpec # ColConstrUnique - | checkConstraintDef # ColConstrCheck - ; - -checkConstraintDef - : CHECK PAREN_LEFT searchCondition PAREN_RIGHT - ; - -uniqueSpec - : PRIMARY KEY # PrimaryKey - | UNIQUE # Unique - ; - -uniqueConstraintDef - : uniqueSpec PAREN_LEFT columnName (COMMA columnName)* PAREN_RIGHT + : NOT NULL # ColConstrNotNull + | NULL # ColConstrNull ; -// ::= | OR -// we cannot do exactly that for the way expression precedence is structured in the grammar file. -// but we at least can eliminate SFW query here. -searchCondition : exprOr; - -// SQL/HIVE DDL Extension, Support additional table metadatas such as partition by, tblProperties, etc. -tableExtension - : PARTITION BY partitionBy # TblExtensionPartition - | TBLPROPERTIES PAREN_LEFT keyValuePair (COMMA keyValuePair)* PAREN_RIGHT # TblExtensionTblProperties - ; - -// Limiting the scope to only allow String as valid value for now -keyValuePair : key=LITERAL_STRING EQ value=LITERAL_STRING; - -// For now: just support a list of column name -// In the future, we might support common partition expression such as Hash(), Range(), etc. -partitionBy - : PAREN_LEFT columnName (COMMA columnName)* PAREN_RIGHT #PartitionColList - ; /** * * DATA MANIPULATION LANGUAGE (DML) @@ -234,6 +194,9 @@ conflictTarget : PAREN_LEFT symbolPrimitive (COMMA symbolPrimitive)* PAREN_RIGHT | ON CONSTRAINT constraintName; +constraintName + : symbolPrimitive; + conflictAction : DO NOTHING | DO REPLACE doReplace @@ -883,19 +846,12 @@ type : datatype=( NULL | BOOL | BOOLEAN | SMALLINT | INTEGER2 | INT2 | INTEGER | INT | INTEGER4 | INT4 | INTEGER8 | INT8 | BIGINT | REAL | CHAR | CHARACTER | MISSING - | STRING | SYMBOL | BLOB | CLOB | DATE | SEXP | BAG | ANY + | STRING | SYMBOL | BLOB | CLOB | DATE | STRUCT | TUPLE | LIST | SEXP | BAG | ANY ) # TypeAtomic - | datatype=(STRUCT|TUPLE|LIST|ARRAY) # TypeComplexUnparameterized | datatype=DOUBLE PRECISION # TypeAtomic | datatype=(CHARACTER|CHAR|FLOAT|VARCHAR) ( PAREN_LEFT arg0=LITERAL_INTEGER PAREN_RIGHT )? # TypeArgSingle | CHARACTER VARYING ( PAREN_LEFT arg0=LITERAL_INTEGER PAREN_RIGHT )? # TypeVarChar | datatype=(DECIMAL|DEC|NUMERIC) ( PAREN_LEFT arg0=LITERAL_INTEGER ( COMMA arg1=LITERAL_INTEGER )? PAREN_RIGHT )? # TypeArgDouble | datatype=(TIME|TIMESTAMP) ( PAREN_LEFT precision=LITERAL_INTEGER PAREN_RIGHT )? (WITH TIME ZONE)? # TypeTimeZone - | datatype=(STRUCT|TUPLE) (ANGLE_LEFT structField ( COMMA structField )* ANGLE_RIGHT) # TypeStruct - | datatype=(LIST|ARRAY) ANGLE_LEFT type ANGLE_RIGHT # TypeList | symbolPrimitive # TypeCustom ; - -structField - : columnName OPTIONAL? COLON type columnConstraint* comment? - ; diff --git a/partiql-parser/src/main/antlr/PartiQLTokens.g4 b/partiql-parser/src/main/antlr/PartiQLTokens.g4 index 20e2d9425..f6ac9b291 100644 --- a/partiql-parser/src/main/antlr/PartiQLTokens.g4 +++ b/partiql-parser/src/main/antlr/PartiQLTokens.g4 @@ -59,7 +59,6 @@ COALESCE: 'COALESCE'; COLLATE: 'COLLATE'; COLLATION: 'COLLATION'; COLUMN: 'COLUMN'; -COMMENT: 'COMMENT'; COMMIT: 'COMMIT'; CONNECT: 'CONNECT'; CONNECTION: 'CONNECTION'; @@ -176,7 +175,6 @@ ON: 'ON'; ONLY: 'ONLY'; OPEN: 'OPEN'; OPTION: 'OPTION'; -OPTIONAL: 'OPTIONAL'; OR: 'OR'; ORDER: 'ORDER'; OUTER: 'OUTER'; @@ -289,14 +287,13 @@ MODIFIED: 'MODIFIED'; NEW: 'NEW'; OLD: 'OLD'; NOTHING: 'NOTHING'; -TBLPROPERTIES: 'TBLPROPERTIES'; /** * * DATA TYPES * */ -ARRAY: 'ARRAY'; + TUPLE: 'TUPLE'; INTEGER2: 'INTEGER2'; INT2: 'INT2'; 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 ab893442d..108367e39 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,9 +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.Constraint import org.partiql.ast.DatetimeField -import org.partiql.ast.DdlOp import org.partiql.ast.Exclude import org.partiql.ast.Expr import org.partiql.ast.From @@ -44,7 +42,6 @@ import org.partiql.ast.GroupBy import org.partiql.ast.Identifier import org.partiql.ast.Let import org.partiql.ast.OnConflict -import org.partiql.ast.PartitionBy import org.partiql.ast.Path import org.partiql.ast.Returning import org.partiql.ast.Select @@ -52,16 +49,8 @@ import org.partiql.ast.SetOp import org.partiql.ast.SetQuantifier import org.partiql.ast.Sort import org.partiql.ast.Statement +import org.partiql.ast.TableDefinition import org.partiql.ast.Type -import org.partiql.ast.constraint -import org.partiql.ast.constraintDefinitionCheck -import org.partiql.ast.constraintDefinitionNotNull -import org.partiql.ast.constraintDefinitionNullable -import org.partiql.ast.constraintDefinitionUnique -import org.partiql.ast.ddlOpCreateIndex -import org.partiql.ast.ddlOpCreateTable -import org.partiql.ast.ddlOpDropIndex -import org.partiql.ast.ddlOpDropTable import org.partiql.ast.exclude import org.partiql.ast.excludeItem import org.partiql.ast.excludeStepCollIndex @@ -141,7 +130,6 @@ import org.partiql.ast.onConflictActionDoUpdate import org.partiql.ast.onConflictTargetConstraint import org.partiql.ast.onConflictTargetSymbols import org.partiql.ast.orderBy -import org.partiql.ast.partitionByAttrList import org.partiql.ast.path import org.partiql.ast.pathStepIndex import org.partiql.ast.pathStepSymbol @@ -157,7 +145,10 @@ import org.partiql.ast.selectStar import org.partiql.ast.selectValue import org.partiql.ast.setOp import org.partiql.ast.sort -import org.partiql.ast.statementDDL +import org.partiql.ast.statementDDLCreateIndex +import org.partiql.ast.statementDDLCreateTable +import org.partiql.ast.statementDDLDropIndex +import org.partiql.ast.statementDDLDropTable import org.partiql.ast.statementDMLBatchLegacy import org.partiql.ast.statementDMLBatchLegacyOpDelete import org.partiql.ast.statementDMLBatchLegacyOpInsert @@ -178,10 +169,11 @@ import org.partiql.ast.statementExplain import org.partiql.ast.statementExplainTargetDomain import org.partiql.ast.statementQuery import org.partiql.ast.tableDefinition -import org.partiql.ast.tableDefinitionAttribute -import org.partiql.ast.tableProperty +import org.partiql.ast.tableDefinitionColumn +import org.partiql.ast.tableDefinitionColumnConstraint +import org.partiql.ast.tableDefinitionColumnConstraintBodyNotNull +import org.partiql.ast.tableDefinitionColumnConstraintBodyNullable import org.partiql.ast.typeAny -import org.partiql.ast.typeArray import org.partiql.ast.typeBag import org.partiql.ast.typeBlob import org.partiql.ast.typeBool @@ -195,6 +187,7 @@ import org.partiql.ast.typeFloat64 import org.partiql.ast.typeInt2 import org.partiql.ast.typeInt4 import org.partiql.ast.typeInt8 +import org.partiql.ast.typeList import org.partiql.ast.typeMissing import org.partiql.ast.typeNullType import org.partiql.ast.typeNumeric @@ -202,12 +195,12 @@ import org.partiql.ast.typeReal import org.partiql.ast.typeSexp import org.partiql.ast.typeString import org.partiql.ast.typeStruct -import org.partiql.ast.typeStructField import org.partiql.ast.typeSymbol import org.partiql.ast.typeTime import org.partiql.ast.typeTimeWithTz import org.partiql.ast.typeTimestamp import org.partiql.ast.typeTimestampWithTz +import org.partiql.ast.typeTuple import org.partiql.ast.typeVarchar import org.partiql.parser.PartiQLLexerException import org.partiql.parser.PartiQLParser @@ -603,44 +596,23 @@ internal class PartiQLParserDefault : PartiQLParser { * */ - override fun visitQueryDdl(ctx: GeneratedParser.QueryDdlContext): AstNode = translate(ctx) { - statementDDL(visitAs(ctx.ddl())) - } + override fun visitQueryDdl(ctx: GeneratedParser.QueryDdlContext): AstNode = visitDdl(ctx.ddl()) override fun visitDropTable(ctx: GeneratedParser.DropTableContext) = translate(ctx) { val table = visitQualifiedName(ctx.qualifiedName()) - ddlOpDropTable(table) + statementDDLDropTable(table) } override fun visitDropIndex(ctx: GeneratedParser.DropIndexContext) = translate(ctx) { val table = visitSymbolPrimitive(ctx.on) val index = visitSymbolPrimitive(ctx.target) - ddlOpDropIndex(index, table) + statementDDLDropIndex(index, table) } override fun visitCreateTable(ctx: GeneratedParser.CreateTableContext) = translate(ctx) { val table = visitQualifiedName(ctx.qualifiedName()) val definition = ctx.tableDef()?.let { visitTableDef(it) } - val partitionBy = ctx - .tableExtension() - .filterIsInstance() - .let { - if (it.size > 1) throw error(ctx, "Expect one PARTITION BY clause.") - it.firstOrNull()?.let { visitTblExtensionPartition(it) } - } - val tblProperties = ctx - .tableExtension() - .filterIsInstance() - .let { - if (it.size > 1) throw error(ctx, "Expect one TBLPROPERTIES clause.") - val tblPropertiesCtx = it.firstOrNull() - tblPropertiesCtx?.keyValuePair()?.map { - val key = it.key.getStringValue() - val value = it.value.getStringValue() - tableProperty(key, stringValue(value)) - } ?: emptyList() - } - ddlOpCreateTable(table, definition, partitionBy, tblProperties) + statementDDLCreateTable(table, definition) } override fun visitCreateIndex(ctx: GeneratedParser.CreateIndexContext) = translate(ctx) { @@ -648,7 +620,7 @@ internal class PartiQLParserDefault : PartiQLParser { val name: Identifier? = null val table = visitSymbolPrimitive(ctx.symbolPrimitive()) val fields = ctx.pathSimple().map { path -> visitPathSimple(path) } - ddlOpCreateIndex(name, table, fields) + statementDDLCreateIndex(name, table, fields) } override fun visitTableDef(ctx: GeneratedParser.TableDefContext) = translate(ctx) { @@ -656,100 +628,30 @@ internal class PartiQLParserDefault : PartiQLParser { val columns = ctx.tableDefPart().filterIsInstance().map { visitColumnDeclaration(it) } - - val tblConstr = ctx.tableDefPart().filterIsInstance().map { - visitTableConstrDeclaration(it) - } - - tableDefinition(columns, tblConstr) + tableDefinition(columns) } override fun visitColumnDeclaration(ctx: GeneratedParser.ColumnDeclarationContext) = translate(ctx) { - val name = visitSymbolPrimitive(ctx.columnName().symbolPrimitive()) - val type = (visit(ctx.type()) as Type).also { - isValidTypeDeclarationOrThrow(it, ctx.type()) - } - val constraints = ctx.columnConstraint().map { visitColumnConstraint(it) } - val optional = when (ctx.OPTIONAL()) { - null -> false - else -> true - } - val comment = ctx.comment()?.LITERAL_STRING()?.getStringValue() - tableDefinitionAttribute(name, type, constraints, optional, comment) - } - - /** - * For Type Declaration used in DDL: - * We DO NOT support ANY Type, BAG Type, MISSING Type, Or NULL Type - */ - private fun isValidTypeDeclarationOrThrow(type: Type, ctx: GeneratedParser.TypeContext) = when (type) { - is Type.Any, - is Type.Bag, - is Type.Missing, - is Type.NullType -> throw error(ctx, "declaration attribute with $type is not supported") - else -> Unit - } - - private fun isValidTypeParameterOrThrow(type: Type, ctx: GeneratedParser.TypeContext) = when (type) { - is Type.Struct -> { - if (type.fields.isNotEmpty()) throw error(ctx, "using parameterized struct as type parameter is not supported") - else Unit + val name = visitSymbolPrimitive(ctx.columnName().symbolPrimitive()).symbol + val type = visit(ctx.type()) as Type + val constraints = ctx.columnConstraint().map { + visitColumnConstraint(it) } - is Type.Array -> { - if (type.type != null) throw error(ctx, "using parameterized array as type parameter is not supported") - else Unit - } - else -> Unit + tableDefinitionColumn(name, type, constraints) } override fun visitColumnConstraint(ctx: GeneratedParser.ColumnConstraintContext) = translate(ctx) { - val identifier = ctx.constraintName()?.let { symbolToString(it.symbolPrimitive()) } - val body = visit(ctx.columnConstraintDef()) as Constraint.Definition - constraint(identifier, body) + val identifier = ctx.columnConstraintName()?.let { symbolToString(it.symbolPrimitive()) } + val body = visit(ctx.columnConstraintDef()) as TableDefinition.Column.Constraint.Body + tableDefinitionColumnConstraint(identifier, body) } override fun visitColConstrNotNull(ctx: GeneratedParser.ColConstrNotNullContext) = translate(ctx) { - constraintDefinitionNotNull() + tableDefinitionColumnConstraintBodyNotNull() } override fun visitColConstrNull(ctx: GeneratedParser.ColConstrNullContext) = translate(ctx) { - constraintDefinitionNullable() - } - - override fun visitColConstrUnique(ctx: GeneratedParser.ColConstrUniqueContext) = translate(ctx) { - when (ctx.uniqueSpec()) { - is GeneratedParser.PrimaryKeyContext -> constraintDefinitionUnique(null, true) - is GeneratedParser.UniqueContext -> constraintDefinitionUnique(null, false) - else -> throw error(ctx, "Expect UNIQUE or PRIMARY KEY") - } - } - - override fun visitCheckConstraintDef(ctx: GeneratedParser.CheckConstraintDefContext) = translate(ctx) { - val searchCondition = visitAs(ctx.searchCondition()) - constraintDefinitionCheck(searchCondition) - } - - override fun visitUniqueConstraintDef(ctx: GeneratedParser.UniqueConstraintDefContext) = translate(ctx) { - val isPrimaryKey = when (ctx.uniqueSpec()) { - is GeneratedParser.PrimaryKeyContext -> true - is GeneratedParser.UniqueContext -> false - else -> throw error(ctx, "Expect UNIQUE or PRIMARY KEY") - } - val columns = ctx.columnName().map { visitSymbolPrimitive(it.symbolPrimitive()) } - constraintDefinitionUnique(columns, isPrimaryKey) - } - - override fun visitTableConstrDeclaration(ctx: GeneratedParser.TableConstrDeclarationContext) = translate(ctx) { - val identifier = ctx.constraintName()?.let { symbolToString(it.symbolPrimitive()) } - val body = visit(ctx.tableConstraintDef()) as Constraint.Definition - constraint(identifier, body) - } - - override fun visitTblExtensionPartition(ctx: GeneratedParser.TblExtensionPartitionContext) = - ctx.partitionBy().accept(this) as PartitionBy - - override fun visitPartitionColList(ctx: GeneratedParser.PartitionColListContext) = translate(ctx) { - partitionByAttrList(ctx.columnName().map { visitSymbolPrimitive(it.symbolPrimitive()) }) + tableDefinitionColumnConstraintBodyNullable() } /** @@ -1670,7 +1572,7 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitPredicateIs(ctx: GeneratedParser.PredicateIsContext) = translate(ctx) { val value = visitAs(ctx.lhs) - val type = visitAs(ctx.type()).also { isValidTypeParameterOrThrow(it, ctx.type()) } + val type = visitAs(ctx.type()) val not = ctx.NOT() != null exprIsType(value, type, not) } @@ -1831,19 +1733,19 @@ internal class PartiQLParserDefault : PartiQLParser { override fun visitCast(ctx: GeneratedParser.CastContext) = translate(ctx) { val expr = visitExpr(ctx.expr()) - val type = visitAs(ctx.type()).also { isValidTypeParameterOrThrow(it, ctx.type()) } + val type = visitAs(ctx.type()) exprCast(expr, type) } override fun visitCanCast(ctx: GeneratedParser.CanCastContext) = translate(ctx) { val expr = visitExpr(ctx.expr()) - val type = visitAs(ctx.type()).also { isValidTypeParameterOrThrow(it, ctx.type()) } + val type = visitAs(ctx.type()) exprCanCast(expr, type) } override fun visitCanLosslessCast(ctx: GeneratedParser.CanLosslessCastContext) = translate(ctx) { val expr = visitExpr(ctx.expr()) - val type = visitAs(ctx.type()).also { isValidTypeParameterOrThrow(it, ctx.type()) } + val type = visitAs(ctx.type()) exprCanLosslessCast(expr, type) } @@ -2174,6 +2076,9 @@ internal class PartiQLParserDefault : PartiQLParser { GeneratedParser.BLOB -> typeBlob(null) GeneratedParser.CLOB -> typeClob(null) GeneratedParser.DATE -> typeDate() + GeneratedParser.STRUCT -> typeStruct() + GeneratedParser.TUPLE -> typeTuple() + GeneratedParser.LIST -> typeList() GeneratedParser.SEXP -> typeSexp() GeneratedParser.BAG -> typeBag() GeneratedParser.ANY -> typeAny() @@ -2235,44 +2140,6 @@ internal class PartiQLParserDefault : PartiQLParser { typeCustom(ctx.text.uppercase()) } - override fun visitTypeComplexUnparameterized(ctx: GeneratedParser.TypeComplexUnparameterizedContext) = translate(ctx) { - when (ctx.datatype.type) { - GeneratedParser.STRUCT, GeneratedParser.TUPLE -> typeStruct(emptyList()) - GeneratedParser.ARRAY, GeneratedParser.LIST -> typeArray(null) - else -> throw error(ctx.datatype, "Invalid datatype") - } - } - - override fun visitTypeList(ctx: GeneratedParser.TypeListContext) = translate(ctx) { - val type = visitOrNull(ctx.type()) - ?.also { isValidTypeDeclarationOrThrow(it, ctx.type()) } - typeArray(type) - } - - override fun visitTypeStruct(ctx: GeneratedParser.TypeStructContext) = translate(ctx) { - val fields = ctx.structField().map { structFieldCtx -> - val name = visitSymbolPrimitive(structFieldCtx.columnName().symbolPrimitive()) - val type = visitAs(structFieldCtx.type()) - .also { isValidTypeDeclarationOrThrow(it, structFieldCtx.type()) } - - val constraints = structFieldCtx.columnConstraint().map { - when (it.columnConstraintDef()) { - is GeneratedParser.ColConstrNullContext, - is GeneratedParser.ColConstrNotNullContext -> visitColumnConstraint(it) - else -> throw error(it, "Only NULL Constraint and NOT NULL Constraint are allowed in Struct field") - } - } - val optional = when (structFieldCtx.OPTIONAL()) { - null -> false - else -> true - } - val comment = structFieldCtx.comment()?.LITERAL_STRING()?.getStringValue() - - typeStructField(name, type, constraints, optional, comment) - } - typeStruct(fields) - } - private inline fun visitOrEmpty(ctx: List?): List = when { ctx.isNullOrEmpty() -> emptyList() else -> ctx.map { visit(it) as T } 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 48709c800..3fbb0321a 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 @@ -1,36 +1,16 @@ package org.partiql.parser.internal -import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtensionContext import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.ArgumentsProvider import org.junit.jupiter.params.provider.ArgumentsSource -import org.partiql.ast.Constraint -import org.partiql.ast.DdlOp -import org.partiql.ast.Expr +import org.partiql.ast.AstNode import org.partiql.ast.Identifier -import org.partiql.ast.PartitionBy -import org.partiql.ast.Type -import org.partiql.ast.constraint -import org.partiql.ast.constraintDefinitionCheck -import org.partiql.ast.constraintDefinitionNotNull -import org.partiql.ast.constraintDefinitionUnique -import org.partiql.ast.ddlOpCreateTable -import org.partiql.ast.ddlOpDropTable -import org.partiql.ast.exprLit -import org.partiql.ast.exprOperator -import org.partiql.ast.exprVar import org.partiql.ast.identifierQualified import org.partiql.ast.identifierSymbol -import org.partiql.ast.statementDDL -import org.partiql.ast.tableDefinition -import org.partiql.ast.tableDefinitionAttribute -import org.partiql.ast.tableProperty -import org.partiql.parser.PartiQLParserException -import org.partiql.value.PartiQLValueExperimental -import org.partiql.value.int32Value -import org.partiql.value.stringValue +import org.partiql.ast.statementDDLCreateTable +import org.partiql.ast.statementDDLDropTable import java.util.stream.Stream import kotlin.test.assertEquals @@ -41,37 +21,21 @@ class PartiQLParserDDLTests { data class SuccessTestCase( val description: String? = null, val query: String, - val expectedOp: DdlOp + val node: AstNode ) - data class ErrorTestCase( - val description: String? = null, - val query: String, - ) - - @ArgumentsSource(SuccessTestProvider::class) + @ArgumentsSource(TestProvider::class) @ParameterizedTest - fun successTests(tc: SuccessTestCase) = assertExpression(tc.query, tc.expectedOp) + fun errorTests(tc: SuccessTestCase) = assertExpression(tc.query, tc.node) - @ArgumentsSource(ErrorTestProvider::class) - @ParameterizedTest - fun errorTests(tc: ErrorTestCase) = assertIssue(tc.query) - - class SuccessTestProvider : ArgumentsProvider { - @OptIn(PartiQLValueExperimental::class) + class TestProvider : ArgumentsProvider { val createTableTests = listOf( - // - // Qualified Identifier as Table Name - // - SuccessTestCase( "CREATE TABLE with unqualified case insensitive name", "CREATE TABLE foo", - ddlOpCreateTable( + statementDDLCreateTable( identifierSymbol("foo", Identifier.CaseSensitivity.INSENSITIVE), - null, - null, - emptyList() + null ) ), // Support Case Sensitive identifier as table name @@ -80,17 +44,15 @@ class PartiQLParserDDLTests { SuccessTestCase( "CREATE TABLE with unqualified case sensitive name", "CREATE TABLE \"foo\"", - ddlOpCreateTable( + statementDDLCreateTable( identifierSymbol("foo", Identifier.CaseSensitivity.SENSITIVE), - null, - null, - emptyList() + null ) ), SuccessTestCase( "CREATE TABLE with qualified case insensitive name", "CREATE TABLE myCatalog.mySchema.foo", - ddlOpCreateTable( + statementDDLCreateTable( identifierQualified( identifierSymbol("myCatalog", Identifier.CaseSensitivity.INSENSITIVE), listOf( @@ -98,15 +60,13 @@ class PartiQLParserDDLTests { identifierSymbol("foo", Identifier.CaseSensitivity.INSENSITIVE), ) ), - null, - null, - emptyList() + null ) ), SuccessTestCase( "CREATE TABLE with qualified name with mixed case sensitivity", "CREATE TABLE myCatalog.\"mySchema\".foo", - ddlOpCreateTable( + statementDDLCreateTable( identifierQualified( identifierSymbol("myCatalog", Identifier.CaseSensitivity.INSENSITIVE), listOf( @@ -114,795 +74,7 @@ class PartiQLParserDDLTests { identifierSymbol("foo", Identifier.CaseSensitivity.INSENSITIVE), ) ), - null, - null, - emptyList() - ) - ), - - // - // Column Constraints - // - SuccessTestCase( - "CREATE TABLE with Column NOT NULL Constraint", - """ - CREATE TABLE tbl ( - a INT2 NOT NULL - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - listOf(constraint(null, constraintDefinitionNotNull())), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with Column Unique Constraint", - """ - CREATE TABLE tbl ( - a INT2 UNIQUE - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - listOf(constraint(null, constraintDefinitionUnique(null, false))), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with Column Primary Key Constraint", - """ - CREATE TABLE tbl ( - a INT2 PRIMARY KEY - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - listOf(constraint(null, constraintDefinitionUnique(null, true))), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with Column CHECK Constraint", - """ - CREATE TABLE tbl ( - a INT2 CHECK (a > 0) - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - listOf( - constraint( - null, - constraintDefinitionCheck( - exprOperator( - ">", - exprVar(identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), Expr.Var.Scope.DEFAULT), - exprLit(int32Value(0)) - ) - ) - ) - ), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with Table Unique Constraint", - """ - CREATE TABLE tbl ( - UNIQUE (a, b) - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - emptyList(), - listOf( - constraint( - null, - constraintDefinitionUnique( - listOf( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - ), - false - ) - ) - ) - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with Table Primary Key Constraint", - """ - CREATE TABLE tbl ( - PRIMARY KEY (a, b) - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - emptyList(), - listOf( - constraint( - null, - constraintDefinitionUnique( - listOf( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - ), - true - ) - ) - ) - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with Table CHECK Constraint", - """ - CREATE TABLE tbl ( - CHECK (a > 0) - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - emptyList(), - listOf( - constraint( - null, - constraintDefinitionCheck( - exprOperator( - ">", - exprVar(identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), Expr.Var.Scope.DEFAULT), - exprLit(int32Value(0)) - ) - ) - ) - ) - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with CASE SENSITIVE Identifier as column name", - """ - CREATE TABLE tbl ( - "a" INT2 - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.SENSITIVE), - Type.Int2(), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with STRUCT", - """ - CREATE TABLE tbl ( - a STRUCT< - b: INT2, - c: INT2 NOT NULL - > - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - false, - null - ), - Type.Struct.Field( - identifierSymbol("c", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - listOf(Constraint(null, Constraint.Definition.NotNull())), - false, - null - ) - ) - ), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with STRUCT of complex", - """ - CREATE TABLE tbl ( - a STRUCT< - b: STRUCT , - d: ARRAY - > - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("c", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - false, - null - ), - ) - ), - emptyList(), - false, - null - ), - Type.Struct.Field( - identifierSymbol("d", Identifier.CaseSensitivity.INSENSITIVE), - Type.Array(Type.Int2()), - emptyList(), - false, - null - ) - ) - ), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with empty", - """ - CREATE TABLE tbl ( - a STRUCT - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - emptyList() - ), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with ARRAY", - """ - CREATE TABLE tbl ( - a ARRAY - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Array(Type.Int2()), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - SuccessTestCase( - "CREATE TABLE with ARRAY of Struct", - """ - CREATE TABLE tbl ( - a ARRAY< STRUCT< b:INT2 > > - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Array( - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - false, - null - ), - ) - ), - ), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - SuccessTestCase( - "CREATE TABLE no space between angle right", - """ - CREATE TABLE tbl( - a LIST> - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Array( - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - false, - null - ), - ) - ), - ), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with ARRAY without element type", - """ - CREATE TABLE tbl ( - a ARRAY - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Array(null), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - // - // Optional keyword - // - SuccessTestCase( - "CREATE TABLE with top level attribute optional", - """ - CREATE TABLE tbl ( - a OPTIONAL INT2 - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - true, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with struct optional field", - """ - CREATE TABLE tbl ( - a STRUCT - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - true, - null - ) - ) - ), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with optional struct which has optional field", - """ - CREATE TABLE tbl ( - a OPTIONAL STRUCT - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - true, - null - ) - ) - ), - emptyList(), - true, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - // COMMENT keyword - SuccessTestCase( - "CREATE TABLE with comment on top level attribute ", - """ - CREATE TABLE tbl ( - a INT2 COMMENT 'attribute a' - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - false, - "attribute a" - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with comment on struct field", - """ - CREATE TABLE tbl ( - a STRUCT - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - false, - "comment on struct field" - ) - ) - ), - emptyList(), - false, - null - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with comment on struct which has comment on field", - """ - CREATE TABLE tbl ( - a STRUCT COMMENT 'comment on top level' - ) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - tableDefinition( - listOf( - tableDefinitionAttribute( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - Type.Struct( - listOf( - Type.Struct.Field( - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - Type.Int2(), - emptyList(), - false, - "comment on inner level" - ) - ) - ), - emptyList(), - false, - "comment on top level" - ) - ), - emptyList() - ), - null, - emptyList() - ) - ), - - // Partition BY - SuccessTestCase( - "CREATE TABLE with Partition by single attribute", - """ - CREATE TABLE tbl - PARTITION BY (a) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - null, - PartitionBy.AttrList( - listOf( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - ) - ), - emptyList() - ) - ), - - SuccessTestCase( - "CREATE TABLE with Partition by multiple attribute", - """ - CREATE TABLE tbl - PARTITION BY (a, b) - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - null, - PartitionBy.AttrList( - listOf( - identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE), - identifierSymbol("b", Identifier.CaseSensitivity.INSENSITIVE), - ) - ), - emptyList() - ) - ), - - // Table Properties - SuccessTestCase( - "CREATE TABLE with TBLPROPERTIES single property", - """ - CREATE TABLE tbl - TBLPROPERTIES ('k1' = 'v1') - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - null, - null, - listOf(tableProperty("k1", stringValue("v1"))) - ) - ), - - SuccessTestCase( - "CREATE TABLE with TBLPROPERTIES preserve case sensitivity", - """ - CREATE TABLE tbl - TBLPROPERTIES ('K1k' = 'V1v') - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - null, - null, - listOf(tableProperty("K1k", stringValue("V1v"))) - ) - ), - - SuccessTestCase( - "CREATE TABLE with TBLPROPERTIES multiple properties", - """ - CREATE TABLE tbl - TBLPROPERTIES ('k1' = 'v1', 'k2' = 'v2') - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - null, - null, - listOf( - tableProperty("k1", stringValue("v1")), - tableProperty("k2", stringValue("v2")) - ) - ) - ), - - SuccessTestCase( - "CREATE TABLE with TBLPROPERTIES and PARTITION BY", - """ - CREATE TABLE tbl - PARTITION BY (a) - TBLPROPERTIES ('k1' = 'v1') - """.trimIndent(), - ddlOpCreateTable( - identifierSymbol("tbl", Identifier.CaseSensitivity.INSENSITIVE), - null, - PartitionBy.AttrList(listOf(identifierSymbol("a", Identifier.CaseSensitivity.INSENSITIVE),),), - listOf(tableProperty("k1", stringValue("v1")),) + null ) ), ) @@ -911,21 +83,21 @@ class PartiQLParserDDLTests { SuccessTestCase( "DROP TABLE with unqualified case insensitive name", "DROP TABLE foo", - ddlOpDropTable( + statementDDLDropTable( identifierSymbol("foo", Identifier.CaseSensitivity.INSENSITIVE), ) ), SuccessTestCase( "DROP TABLE with unqualified case sensitive name", "DROP TABLE \"foo\"", - ddlOpDropTable( + statementDDLDropTable( identifierSymbol("foo", Identifier.CaseSensitivity.SENSITIVE), ) ), SuccessTestCase( "DROP TABLE with qualified case insensitive name", "DROP TABLE myCatalog.mySchema.foo", - ddlOpDropTable( + statementDDLDropTable( identifierQualified( identifierSymbol("myCatalog", Identifier.CaseSensitivity.INSENSITIVE), listOf( @@ -938,7 +110,7 @@ class PartiQLParserDDLTests { SuccessTestCase( "DROP TABLE with qualified name with mixed case sensitivity", "DROP TABLE myCatalog.\"mySchema\".foo", - ddlOpDropTable( + statementDDLDropTable( identifierQualified( identifierSymbol("myCatalog", Identifier.CaseSensitivity.INSENSITIVE), listOf( @@ -954,166 +126,9 @@ class PartiQLParserDDLTests { (createTableTests + dropTableTests).map { Arguments.of(it) }.stream() } - class ErrorTestProvider : ArgumentsProvider { - - val errorTestCases = listOf( - ErrorTestCase( - "Create Table Illegal Check Expression", - """ - CREATE TABLE TBL( - CHECK (SELECT a FROM foo) - ) - """.trimIndent() - ), - ErrorTestCase( - "NULL not allowed as type in type declaration", - """ - CREATE TABLE TBL( - a NULL - ) - """.trimIndent() - ), - ErrorTestCase( - "MISSING not allowed as type in type declaration", - """ - CREATE TABLE TBL( - a MISSING - ) - """.trimIndent() - ), - ErrorTestCase( - "STRUCT<> NOT Supported", - """ - CREATE TABLE TBL( - a STRUCT<> - ) - """.trimIndent() - ), - ErrorTestCase( - "LIST<> NOT Supported", - """ - CREATE TABLE TBL( - a LIST<> - ) - """.trimIndent() - ), - ErrorTestCase( - "Multiple Partition by not allowed", - """ - CREATE TABLE TBL - PARTITION BY (a) - PARTITION BY (b) - """.trimIndent() - ), - ErrorTestCase( - "Empty Partition by not allowed", - """ - CREATE TABLE TBL - PARTITION BY () - """.trimIndent() - ), - - ErrorTestCase( - "Multiple TBLPROPERTIES not allowed", - """ - CREATE TABLE TBL - TBLPROPERTIES('k1' = 'v1') - TBLPROPERTIES('k2' = 'v2') - """.trimIndent() - ), - - ErrorTestCase( - "Empty TBLPROPERTIES not allowed", - """ - CREATE TABLE TBL - TBLPROPERTIES() - """.trimIndent() - ), - - ErrorTestCase( - "TBLPROPERTIES only allowed String value", - """ - CREATE TABLE TBL - TBLPROPERTIES('k1' = 1) - """.trimIndent() - ), - - ErrorTestCase( - "TBLPROPERTIES only allowed String key", - """ - CREATE TABLE TBL - TBLPROPERTIES(1 = '1') - """.trimIndent() - ), - - ErrorTestCase( - "OPTIONAL needs to follow attribute name", - """ - CREATE TABLE TBL ( - a INT2 OPTIONAL - ) - """.trimIndent() - ), - - ErrorTestCase( - "Multiple Optional not allowed", - """ - CREATE TABLE TBL ( - a OPTIONAL OPTIONAL INT2 - ) - """.trimIndent() - ), - - ErrorTestCase( - "Multiple COMMENT not allowed", - """ - CREATE TABLE TBL ( - a INT2 COMMENT 'comment1' COMMENT 'comment2' - ) - """.trimIndent() - ), - - ErrorTestCase( - "Inline comment needs to appear last", - """ - CREATE TABLE TBL ( - a INT2 COMMENT 'comment1' NOT NULL - ) - """.trimIndent() - ), - - // TODO: Move this to another place as part of parser test porting process - ErrorTestCase( - "Struct Field declaration not allowed for is Operator", - "a IS STRUCT" - ), - ErrorTestCase( - "Struct Field declaration not allowed for CAST Operator", - "CAST(a AS STRUCT)" - ), - ErrorTestCase( - "ELEMENT declaration for LIST Type not allowed for is Operator", - "a IS LIST" - ), - ErrorTestCase( - "Struct Field declaration not allowed for CAST Operator", - "CAST(a AS LIST)" - ), - ) - override fun provideArguments(p0: ExtensionContext?): Stream = - errorTestCases.map { Arguments.of(it) }.stream() - } - - private fun assertExpression(input: String, expected: DdlOp) { + private fun assertExpression(input: String, expected: AstNode) { val result = parser.parse(input) val actual = result.root - assertEquals(statementDDL(expected), actual) - } - - // For now, just assert throw - private fun assertIssue(input: String) { - assertThrows { - parser.parse(input) - } + assertEquals(expected, actual) } } diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/SqlTypes.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/SqlTypes.kt index 0d3938ab7..9dee936cd 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/SqlTypes.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/SqlTypes.kt @@ -207,7 +207,6 @@ internal object SqlTypes { } is Type.Any -> dynamic() is Type.List -> array() - is Type.Array -> array(type.type?.let { from(it) }) is Type.Tuple -> struct() is Type.Struct -> struct() is Type.Custom -> TODO("Custom type not supported ") 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/transforms/NormalizeSelect.kt index cd2649dd6..6d6bc923d 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/NormalizeSelect.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/NormalizeSelect.kt @@ -285,7 +285,7 @@ internal object NormalizeSelect { expr = null, branches = listOf( exprCaseBranch( - condition = exprIsType(expr, typeStruct(emptyList()), null), + condition = exprIsType(expr, typeStruct(), null), expr = expr ) ), diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RexConverter.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RexConverter.kt index 26e6c90a7..af6c80e23 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RexConverter.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/transforms/RexConverter.kt @@ -661,14 +661,12 @@ internal object RexConverter { is Type.TimestampWithTz -> call("is_timestampWithTz", arg0) is Type.Interval -> call("is_interval", arg0) is Type.Bag -> call("is_bag", arg0) - is Type.Sexp -> call("is_sexp", arg0) - is Type.Any -> call("is_any", arg0) - is Type.Custom -> call("is_custom", arg0) is Type.List -> call("is_list", arg0) + is Type.Sexp -> call("is_sexp", arg0) is Type.Tuple -> call("is_tuple", arg0) - // Note that for is function, the parser will reject parameterized list/struct - is Type.Array -> call("is_list", arg0) is Type.Struct -> call("is_struct", arg0) + is Type.Any -> call("is_any", arg0) + is Type.Custom -> call("is_custom", arg0) } if (node.not == true) { @@ -854,10 +852,6 @@ internal object RexConverter { is Type.Custom -> TODO("Custom type not supported ") is Type.List -> PType.typeList() is Type.Tuple -> PType.typeStruct() - is Type.Array -> when (type.type) { - null -> PType.typeList() - else -> PType.typeList(visitType(type.type!!)) - } is Type.Struct -> PType.typeStruct() }.toCType() }