diff --git a/samples/DuckDbFlightSQL/.vscode/settings.json b/samples/DuckDbFlightSQL/.vscode/settings.json new file mode 100644 index 0000000..c313ed4 --- /dev/null +++ b/samples/DuckDbFlightSQL/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "powerquery.general.mode": "SDK", + "powerquery.sdk.test.settingsFiles": "./Tests/Settings", + "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\DuckDb.mez", + "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\DuckDb.query.pq" +} diff --git a/samples/DuckDbFlightSQL/DuckDb.pq b/samples/DuckDbFlightSQL/DuckDb.pq new file mode 100644 index 0000000..850d4a8 --- /dev/null +++ b/samples/DuckDbFlightSQL/DuckDb.pq @@ -0,0 +1,426 @@ +// DuckDb.pq — Sample DuckDb connector using FlightSQL via Adbc.Connection. +// Demonstrates: +// - Connecting to DuckDb over FlightSQL (gRPC) +// - Navigation tree: Databases > Schemas > Tables +// - Query folding via SqlGenerator +// - Primary & Foreign key relationships +// - SQL-based metadata retrieval from information_schema +// +// This connector uses Adbc.Connection only (no Adbc.DataSource, Adbc.Query, or ODBC). +// User-facing parameters are high-level (Server, Encryption, Database). +// All ADBC-level properties (adbc.flight.sql.*) are mapped internally — +// the user never sees or configures raw ADBC keys. +// Credentials (Username/Password, API Key) are handled via Extension.CurrentCredential(). +[Version = "1.0.0"] +section DuckDb; + +[DataSource.Kind = "DuckDb", Publish = "DuckDb.Publish"] +shared DuckDb.Contents = Value.ReplaceType(DuckDbConnectorImpl, DuckDbConnectorType); + +DuckDbConnectorType = + let + FunctionType = Type.ForFunction( + [ + Parameters = [ + server = (type text) meta [ + Documentation.FieldCaption = "Server", + Documentation.FieldDescription = "The DuckDb FlightSQL server hostname or hostname:port (e.g., localhost:32010)", + Documentation.SampleValues = {"localhost:32010", "duckdb.example.com"} + ], + encryption = (type text) meta [ + Documentation.FieldCaption = "Encryption", + Documentation.FieldDescription = "Whether to use TLS encryption for the gRPC connection", + Documentation.AllowedValues = {"Enabled", "Disabled"} + ], + optional database = (type text) meta [ + Documentation.FieldCaption = "Database", + Documentation.FieldDescription = "Optional: the DuckDb database name to connect to", + Documentation.SampleValues = {"my_database"} + ] + ], + ReturnType = type table + ], + 2 + ), + WithDocumentation = Value.ReplaceMetadata( + FunctionType, + [ + Documentation.Name = "DuckDb (FlightSQL)", + Documentation.LongDescription = "Connect to a DuckDb instance via the FlightSQL (gRPC) protocol using ADBC. " + & "This sample connector demonstrates Adbc.Connection-based navigation with query folding, " + & "type mapping, and relationship detection via primary/foreign keys.", + Documentation.Examples = {[ + Description = "Connect to a local DuckDb FlightSQL server", + Code = "DuckDb.Contents(""localhost:32010"", ""Disabled"")", + Result = "Returns the DuckDb navigation table" + ]} + ] + ) + in + WithDocumentation; + +DuckDbSqlGenerator = Extension.LoadExpression("SqlGenerator.pqm"); +FlightSqlAdbcConfig = Extension.LoadExpression("FlightSqlAdbcConfig.pqm"); + +Adbc.Connection = try #shared[Adbc.Connection] otherwise (driver, databaseProperties, connectionProperties, options) => + error Error.Record("Expression.Error", "The Adbc.Connection function is not available in this environment"); +Tables.NavigationPropertyGenerator = try #shared[Tables.NavigationPropertyGenerator] otherwise null; + +ModuleIdentifier = () => ...; +MakeUniqueIdentifier = (connectionString as record) as record => [Module = ModuleIdentifier, Signature = connectionString]; + +DuckDbConnectorImpl = (server as text, encryption as text, optional database as text) as table => + let + Address = ParseServerAddress(server), + EncryptionEnabled = encryption <> "Disabled", + UriSchema = if EncryptionEnabled then "grpc+tls" else "grpc", + Uri = UriSchema & "://" & Address[Host] & ":" & Text.From(Address[Port]), + + // Build the connection string from user-friendly parameters. + // All ADBC-level properties are mapped here — the user never sees them. + DatabaseHeaders = if database <> null then + RecordToHeaders([database = database]) + else [], + CredentialProperties = GetCredentialConnectionProperties(), + + ConnectionString = [uri = Uri] & DatabaseHeaders & CredentialProperties, + + Connection = Adbc.Connection(FlightSqlAdbcConfig, ConnectionString, [], [ConnectionPoolType = 2]), + ExecuteQueryCtor = (cxn as record) => (sql as text, optional opts as record) => + let options = [IsMetadata = opts[IsMetadata]?] + in cxn[ExecuteQuery](sql, null, options), + GetData = (query as text, resultType as type, ctx as record) => + CreateDataTable(query, resultType, ctx, context[ExecuteQuery]), + UniqueIdentifier = MakeUniqueIdentifier(ConnectionString), + SqlGen = SqlView.Generator(UniqueIdentifier, DuckDbSqlGenerator[SqlGenerator], GetData), + NavPropGenerator = if Tables.NavigationPropertyGenerator = null then null else + Tables.NavigationPropertyGenerator(null, (path) => + AdbcDatabases{[Name = path{0}]}[Data]{[Name = path{1}]}[Data]{[Name = path{2}]}[Data]), + context = [ + Connection = Connection, ExecuteQuery = ExecuteQueryCtor(Connection), + ExecuteQueryCtor = ExecuteQueryCtor, SqlGenerator = SqlGen, NavPropGenerator = NavPropGenerator + ], + AdbcDatabases = GetDatabases(context, database) + in AdbcDatabases; + +// ============================================================================ +// CREDENTIAL HANDLING +// Credentials are provided by Power BI's credential dialog (Extension.CurrentCredential). +// The user selects Username/Password, API Key, or Anonymous in the auth UI — +// this function maps that to the appropriate ADBC connection properties internally. +// ============================================================================ +GetCredentialConnectionProperties = () => + let + Credential = Extension.CurrentCredential() + in + if Credential[AuthenticationKind]? = "UsernamePassword" then + [username = Credential[Username], password = Credential[Password]] + else if Credential[AuthenticationKind]? = "Key" then + [#"adbc.flight.sql.authorization_header" = "Bearer " & Credential[Key]] + else + []; + +// ============================================================================ +// HEADER HELPERS +// Converts a record of user-friendly key/value pairs into ADBC Flight RPC +// call headers. The user provides values like [database = "mydb"] and this +// maps them to "adbc.flight.sql.rpc.call_header.database" = "mydb" internally. +// ============================================================================ +RecordToHeaders = (input as record) as record => + let + NonNullFields = List.Select(Record.FieldNames(input), each Record.Field(input, _) <> null) + in + Record.FromList( + List.Transform(NonNullFields, each Record.Field(input, _)), + List.Transform(NonNullFields, each "adbc.flight.sql.rpc.call_header." & _) + ); + +// ============================================================================ +// SERVER ADDRESS PARSING +// Accepts a plain hostname or hostname:port. The user does NOT need to specify +// the gRPC scheme (grpc:// or grpc+tls://) — that is determined by the +// Encryption parameter. Default port is 32010. +// ============================================================================ +ParseServerAddress = (server as text) as record => + let + trimmed = Text.Trim(server), + // Strip any scheme prefix if the user accidentally included one + withoutScheme = + if Text.StartsWith(trimmed, "grpc+tls://") then Text.AfterDelimiter(trimmed, "grpc+tls://") + else if Text.StartsWith(trimmed, "grpc+tcp://") then Text.AfterDelimiter(trimmed, "grpc+tcp://") + else if Text.StartsWith(trimmed, "grpc://") then Text.AfterDelimiter(trimmed, "grpc://") + else trimmed, + hostParts = Text.Split(withoutScheme, ":"), + host = hostParts{0}, + port = if List.Count(hostParts) = 2 then Number.FromText(hostParts{1}) else 32010 + in + [Host = host, Port = port]; + +// ============================================================================ +// DATA TABLE CREATION (with Table.View for query folding) +// ============================================================================ +CreateDataTable = (query as text, resultType as type, context as record, executeQuery as function) => + Table.View(null, [ + GetType = () => resultType, + GetRows = () => + let + data = executeQuery(query, context), + oldNames = Table.ColumnNames(data), + newNames = Table.ColumnNames(#table(resultType, {})), + pairs = List.Zip({oldNames, newNames}), + renamed = try Table.RenameColumns(data, pairs, MissingField.Ignore) otherwise data, + projected = Table.SelectColumns(renamed, newNames, MissingField.Ignore) + in projected, + ThrowFoldingFailures = false + ]); + +// ============================================================================ +// NAVIGATION: Databases > Schemas > Tables +// ============================================================================ +MakeNavTableType = (isLeaf as logical) as type => + let + dataType = type table meta [ + NavigationTable.ItemKind = "Table", Preview.Delay = "Table", + NavigationTable.RowConfigurationColumn = "Kind" + ], + tableType = type table [Name = text, Description = nullable text, Data = dataType, Kind = text], + withKeys = Type.ReplaceTableKeys(tableType, {[Columns = {"Name", "Kind"}, Primary = true]}) meta [ + NavigationTable.NameColumn = "Name", NavigationTable.DataColumn = "Data", NavigationTable.KindColumn = "Kind" + ] + in withKeys; + +GetDatabases = (context as record, optional filterDatabase as text) => + let + isLeaf = false, kind = "Database", + command = "SHOW DATABASES", + raw = context[ExecuteQuery](command, [IsMetadata = true]), + tables = Table.RenameColumns(raw, {{"database_name", "Name"}}), + filtered = if filterDatabase <> null then Table.SelectRows(tables, each [Name] = filterDatabase) else tables, + getSchemas = (name) => GetSchemas(context, name), + withDescription = Table.AddColumn(filtered, "Description", each null, type nullable text), + withData = Table.AddColumn(withDescription, "Data", each getSchemas([Name]), type table), + withKind = Table.AddColumn(withData, "Kind", each kind meta [NavigationTable.IsLeaf = isLeaf], type text), + withFolding = Table.View(null, [ + GetType = () => MakeNavTableType(isLeaf), GetRows = () => withKind, + OnSelectRows = (selector) => FoldNavigationStep(withKind, selector, getSchemas, kind), + ThrowFoldingFailures = false + ]) + in withFolding; + +GetSchemas = (context as record, catalog as text) => + let + isLeaf = false, kind = "Schema", + command = "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = " + & EscapeString(catalog) & " AND schema_name <> 'information_schema'", + schemas = context[ExecuteQuery](command, [IsMetadata = true]), + getTables = (name) => GetTables(context, catalog, name), + withDescription = Table.AddColumn(schemas, "Description", each null, type nullable text), + withData = Table.AddColumn(withDescription, "Data", each getTables([Name]), type table), + withKind = Table.AddColumn(withData, "Kind", each kind meta [NavigationTable.IsLeaf = isLeaf], type text), + withFolding = Table.View(null, [ + GetType = () => MakeNavTableType(isLeaf), GetRows = () => withKind, + OnSelectRows = (selector) => FoldNavigationStep(withKind, selector, getTables, kind), + OnNativeQuery = (cmd, params, opts) => try NativeQuery(context, catalog, cmd) catch (e) => error Table.ViewError(e), + ThrowFoldingFailures = false + ]) + in withFolding; + +GetTables = (context as record, catalog as text, schema as text) => + let + isLeaf = true, kind = {"Table", "View"}, + command = Text.Combine({ + "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = ", + EscapeString(catalog), " AND table_schema = ", EscapeString(schema) + }), + tables = context[ExecuteQuery](command, [IsMetadata = true]), + getTable = (name) => GetTable(context, catalog, schema, name), + withDescription = Table.AddColumn(tables, "Description", each null, type nullable text), + withData = Table.AddColumn(withDescription, "Data", each getTable([Name]), type table), + withKind = Table.AddColumn(withData, "Kind", + each (if [table_type] = "VIEW" then "View" else "Table") meta [NavigationTable.IsLeaf = isLeaf], type text), + removeType = Table.RemoveColumns(withKind, {"table_type"}), + withFolding = Table.View(null, [ + GetType = () => MakeNavTableType(isLeaf), GetRows = () => removeType, + OnSelectRows = (selector) => FoldNavigationStep(removeType, selector, getTable, "Table"), + ThrowFoldingFailures = false + ]) + in withFolding; + +GetTable = (context as record, catalog as text, schema as text, table as text) => + let + tableType = GetTableType(context, catalog, schema, table), + tableReference = [Kind = "FromTable", Table = [Schema = schema, Name = table]], + withSqlView = context[SqlGenerator](tableReference, tableType, []), + // Transform nested columns (STRUCT, ARRAY) from text to native M types. + // DuckDB's ADBC driver delivers these as native Arrow list/struct, so values + // are already M list/record — we just re-type the columns to `type any`. + rowFields = Type.RecordFields(Type.TableRow(tableType)), + columnNames = Record.FieldNames(rowFields), + nestedColumns = List.Select(columnNames, (col) => + let + colType = Record.Field(rowFields, col)[Type], + nativeName = Record.FieldOrDefault(Type.Facets(colType), "NativeTypeName", null) + in + nativeName = "STRUCT" or nativeName = "ARRAY" + ), + withNestedTypes = if List.Count(nestedColumns) > 0 + then Table.TransformColumnTypes(withSqlView, List.Transform(nestedColumns, each {_, type any})) + else withSqlView + in withNestedTypes; + +GetTableType = (context as record, catalog as text, schema as text, table as text) => + let + command = Text.Combine({ + "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = ", + EscapeString(catalog), " AND table_schema = ", EscapeString(schema), + " AND table_name = ", EscapeString(table), " ORDER BY ordinal_position" + }), + columns = Table.Buffer(context[ExecuteQuery](command, [IsMetadata = true])), + withType = Table.AddColumn(columns, "Type", + each [Type = GetColumnType([data_type], [is_nullable]), Optional = false]), + rowType = Type.ForRecord(Record.FromList(withType[Type], withType[column_name]), false), + tableType = type table rowType, + withPrimaryKeys = ApplyPrimaryKeys(context, catalog, schema, table, tableType) + in withPrimaryKeys; + +GetColumnType = (typeName as text, isNullable as text) => + let + baseType = if Text.EndsWith(typeName, "[]") then "ARRAY" + else if Text.Contains(typeName, "(") then Text.BeforeDelimiter(typeName, "(") + else typeName, + normalized = Text.Upper(Text.Trim(baseType)), + matchedType = Record.FieldOrDefault(DuckDbSqlGenerator[TypeFacets], normalized, null), + mtype = if matchedType <> null then matchedType else type any + in if isNullable = "YES" then type nullable mtype else mtype; + +// ============================================================================ +// PRIMARY & FOREIGN KEY RELATIONSHIPS +// ============================================================================ +ApplyPrimaryKeys = (context as record, catalog as text, schema as text, table as text, tableType as type) as type => + let + pkCommand = Text.Combine({ + "SELECT kcu.column_name ", + "FROM information_schema.table_constraints tc ", + "JOIN information_schema.key_column_usage kcu ", + " ON tc.constraint_name = kcu.constraint_name ", + " AND tc.table_catalog = kcu.table_catalog ", + " AND tc.table_schema = kcu.table_schema ", + " AND tc.table_name = kcu.table_name ", + "WHERE tc.constraint_type = 'PRIMARY KEY' ", + " AND tc.table_catalog = ", EscapeString(catalog), + " AND tc.table_schema = ", EscapeString(schema), + " AND tc.table_name = ", EscapeString(table), + " ORDER BY kcu.ordinal_position" + }), + pkResult = try context[ExecuteQuery](pkCommand, [IsMetadata = true]) otherwise #table({"column_name"}, {}), + pkColumns = pkResult[column_name], + hasPK = List.Count(pkColumns) > 0, + withPK = if hasPK then Type.ReplaceTableKeys(tableType, {[Columns = pkColumns, Primary = true]}) else tableType + in withPK; + +GetForeignKeys = (context as record, catalog as text, schema as text, table as text) as table => + let + fkCommand = Text.Combine({ + "SELECT kcu.column_name AS from_column, ccu.table_schema AS to_schema, ", + " ccu.table_name AS to_table, ccu.column_name AS to_column ", + "FROM information_schema.table_constraints tc ", + "JOIN information_schema.key_column_usage kcu ", + " ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog ", + " AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name ", + "JOIN information_schema.constraint_column_usage ccu ", + " ON tc.constraint_name = ccu.constraint_name AND tc.table_catalog = ccu.table_catalog ", + "WHERE tc.constraint_type = 'FOREIGN KEY' ", + " AND tc.table_catalog = ", EscapeString(catalog), + " AND tc.table_schema = ", EscapeString(schema), + " AND tc.table_name = ", EscapeString(table) + }), + fkResult = try context[ExecuteQuery](fkCommand, [IsMetadata = true]) + otherwise #table({"from_column", "to_schema", "to_table", "to_column"}, {}) + in fkResult; + +// ============================================================================ +// NATIVE QUERY SUPPORT +// ============================================================================ +NativeQuery = (context as record, catalog as text, cmd as text) => + let + typeQuery = "SELECT * FROM (" & cmd & ") AS ""_"" WHERE 0 = 1", + typeResult = context[ExecuteQuery](typeQuery, []), + tableType = Value.Type(Table.Buffer(typeResult)), + reference = [Kind = "FromQuery", Query = [Kind = "Verbatim", Query = cmd], Alias = "_"], + result = context[SqlGenerator](reference, tableType, []) + in result; + +// ============================================================================ +// HELPERS +// ============================================================================ +EscapeIdentifier = (identifier as text) as text => """" & Text.Replace(identifier, """", """""") & """"; +EscapeString = (string as text) as text => "'" & Text.Replace(string, "'", "''") & "'"; + +FoldNavigationStep = (base as table, selector as function, loader as function, kind as any) => + let + reduceAnd = (ast) => if ast[Kind] = "Binary" and ast[Operator] = "And" then List.Combine({@reduceAnd(ast[Left]), @reduceAnd(ast[Right])}) else {ast}, + matchFieldAccess = (ast) => if ast[Kind] = "FieldAccess" and ast[Expression] = RowExpression.Row then ast[MemberName] else ..., + matchConstant = (ast) => if ast[Kind] = "Constant" then ast[Value] else ..., + matchIndex = (ast) => if ast[Kind] = "Binary" and ast[Operator] = "Equals" then + if ast[Left][Kind] = "FieldAccess" then Record.AddField([], matchFieldAccess(ast[Left]), matchConstant(ast[Right])) + else Record.AddField([], matchFieldAccess(ast[Right]), matchConstant(ast[Left])) + else ..., + predicate1 = Record.Combine(List.Transform(reduceAnd(RowExpression.From(selector)), matchIndex)), + isKindList = kind is list, + kindMatch = if isKindList then List.Contains(kind, predicate1[Kind]?) else predicate1[Kind]? = kind, + predicate2 = if kindMatch then Record.RemoveFields(predicate1, {"Kind"}) else predicate1, + name = if Record.FieldCount(predicate2) = 1 and predicate2[Name]? <> null then predicate2[Name] else ..., + success = not (try name)[HasError] + in + if success then Table.FromRecords({[Name = name, Description = "", Data = loader(name), Kind = kind]}) + else Table.SelectRows(base, selector); + +// ============================================================================ +// EXTENSION LOADERS +// ============================================================================ +Extension.LoadExpression = (name as text) => + let binary = Extension.Contents(name), asText = Text.FromBinary(binary) + in Expression.Evaluate(asText, #shared); + +// ============================================================================ +// DATA SOURCE AND PUBLISH CONFIGURATION +// ============================================================================ +DuckDb = [ + Type = "Custom", + // Resource path format: "server;encryption" or "server;encryption;database" + MakeResourcePath = (server, encryption, optional database) => + let + base = server & ";" & encryption + in + if database <> null then base & ";" & database else base, + ParseResourcePath = (resourcePath as text) => + let + parts = Text.Split(resourcePath, ";"), + server = parts{0}, + encryption = if List.Count(parts) > 1 then parts{1} else "Enabled", + database = if List.Count(parts) > 2 then parts{2} else null + in + {server, encryption, database}, + TestConnection = (resourcePath as text) => + let + parts = Text.Split(resourcePath, ";"), + server = parts{0}, + encryption = if List.Count(parts) > 1 then parts{1} else "Enabled", + database = if List.Count(parts) > 2 then parts{2} else null + in + {"DuckDb.Contents", server, encryption, database}, + Authentication = [ + UsernamePassword = [Name = "DuckDb", Label = "Username & Password"], + Key = [Label = "API Key / Bearer Token", KeyLabel = "Token"], + Anonymous = [] + ], + // Encryption is handled by the connector's own Encryption parameter, not by SupportsEncryption + SupportsEncryption = false +]; + +DuckDb.Publish = [ + Beta = true, Category = "Database", SupportsDirectQuery = true, + NativeQueryProperties = [navigationSteps = {[]}, nativeQueryOptions = [EnableFolding = true]], + ButtonText = {"DuckDb (FlightSQL)", "Connect to DuckDb via FlightSQL"}, + SourceImage = null, SourceTypeImage = null +]; diff --git a/samples/DuckDbFlightSQL/DuckDb.proj b/samples/DuckDbFlightSQL/DuckDb.proj new file mode 100644 index 0000000..799f415 --- /dev/null +++ b/samples/DuckDbFlightSQL/DuckDb.proj @@ -0,0 +1,28 @@ + + + + net8.0 + False + + + + + + + + + + + $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ + $(MSBuildProjectDirectory)\obj\MEZ\ + $(MezOutputDir)$(MSBuildProjectName).mez + + + + + + + + + + diff --git a/samples/DuckDbFlightSQL/DuckDb.query.pq b/samples/DuckDbFlightSQL/DuckDb.query.pq new file mode 100644 index 0000000..847dc16 --- /dev/null +++ b/samples/DuckDbFlightSQL/DuckDb.query.pq @@ -0,0 +1,7 @@ +// Use this file to write queries to test your data connector. +// Pressing Evaluate (or Ctrl+E) in VS Code will execute this query +// against the extension defined in .vscode/settings.json. +let + Source = DuckDb.Contents("localhost:31337", "Disabled") +in + Source diff --git a/samples/DuckDbFlightSQL/FlightSqlAdbcConfig.pqm b/samples/DuckDbFlightSQL/FlightSqlAdbcConfig.pqm new file mode 100644 index 0000000..b4b9da2 --- /dev/null +++ b/samples/DuckDbFlightSQL/FlightSqlAdbcConfig.pqm @@ -0,0 +1,31 @@ +// FlightSqlAdbcConfig.pqm — ADBC driver configuration for DuckDb via FlightSQL. +let + TypeInfo = Extension.LoadExpression("TypeInfo.pqm"), + FlightSqlAdbcConfig = [ + Name = "FlightSqlAdbcDuckDb", + Folder = "FlightSQL", + File = "libadbc_driver_flightsql.dll", + DriverType = "Unmanaged", + EntryPoint = "FlightSqlDriverInit", + IdentifierQuoteChar = """", + CatalogNameSeparator = ".", + TableTypes = "BASE TABLE, VIEW", + SupportsCatalog = true, + SupportsSchema = true, + SupportedConnectionOptions = [ + adbc.connection.catalog = false, + adbc.connection.db_schema = false + ], + TypeInfo = Table.SelectColumns( + TypeInfo, + {"Name", "SqlType", "Unsigned", "ColumnSize", "NumberPrecisionRadix", "LiteralPrefix", "LiteralSuffix"} + ) + ], + Extension.LoadExpression = (name as text) => + let + binary = Extension.Contents(name), + asText = Text.FromBinary(binary) + in + Expression.Evaluate(asText, #shared) +in + FlightSqlAdbcConfig diff --git a/samples/DuckDbFlightSQL/README.md b/samples/DuckDbFlightSQL/README.md new file mode 100644 index 0000000..0a73508 --- /dev/null +++ b/samples/DuckDbFlightSQL/README.md @@ -0,0 +1,104 @@ +# DuckDb Connector (FlightSQL / ADBC) + +A sample Power Query M connector for **DuckDb** using the **FlightSQL** protocol via **ADBC** (Arrow Database Connectivity). Designed as a reference implementation for partners building FlightSQL-based connectors for Power BI. + +## Architecture + +Uses **`Adbc.Connection`** exclusively — no ODBC, `Adbc.Query`, or `Adbc.Database` needed. + +| Feature | Implementation | +| ------------------ | ------------------------------------------------------- | +| **Connection** | `Adbc.Connection` via FlightSQL gRPC | +| **Navigation** | Database → Schema → Table via `information_schema` | +| **Query Folding** | `SqlView.Generator` with DuckDb-specific `SqlGenerator` | +| **Type Mapping** | Full DuckDb coverage (BOOLEAN through STRUCT/MAP) | +| **Relationships** | PK/FK detection via `information_schema` constraints | +| **Authentication** | Username/Password, Bearer Token, Anonymous | +| **DirectQuery** | Supported | +| **Native Query** | Supported with folding | + +## FlightSQL ADBC Driver + +The FlightSQL ADBC driver (`libadbc_driver_flightsql.dll`) ships with both **Power Query SDK Tools** and **Power BI Desktop**. No separate driver installation is needed. + +`FlightSqlAdbcConfig.pqm` configures the driver by specifying: + +- **Driver location**: folder (`FlightSQL`), file name, and entry point (`FlightSqlDriverInit`) +- **Metadata**: catalog/schema support, identifier quoting, supported table types (`BASE TABLE`, `VIEW`) +- **Type mapping**: references `TypeInfo.pqm` for DuckDB-to-M type resolution + +The connector uses `Adbc.Connection` with `grpc://` (TLS disabled) or `grpc+tls://` (TLS enabled) URIs to establish the FlightSQL gRPC connection. + +## Files + +```text +DuckDb/ +├── DuckDb.pq # Main connector entry point +├── DuckDb.query.pq # Evaluation query for SDK testing +├── FlightSqlAdbcConfig.pqm # ADBC driver configuration +├── TypeInfo.pqm # DuckDb type → M type mapping +├── SqlGenerator.pqm # DuckDb SQL generator overrides +├── SqlGeneratorCommon.pqm # Shared Sql92 base infrastructure +├── DuckDb.proj # Power Query SDK project file +├── resources.resx # Localized strings +└── Tests/ + ├── Credentials/ # Credential files for test authentication + ├── ParameterQueries/ # Parameter query definitions + ├── Settings/ # PQTest settings (Sanity, Standard, DatasourceSpecific) + ├── TestSuites/ # Test cases organized by category + │ ├── Setup/ # Docker setup, data loading, readme + │ ├── DatasourceSpecific/ # DuckDB-specific tests + │ └── PerfTests/ # Performance test queries + │ # Sanity & Standard tests use shared testframework/tests/TestSuites/ + ├── RunDuckDbTestsWithVSCodeGuide.md # VS Code test guide + └── RunDuckDbPerfTestsGuide.md # Performance test guide +``` + +## Key Design Decisions + +### Adbc.Connection Only + +Simplest approach for FlightSQL — directly creates a connection, builds navigation via SQL metadata queries, and wires up `SqlView.Generator` for folding. + +### SQL Generator + +The query folding engine uses a three-layer override architecture: + +| Layer | File | Role | +| -------------------- | ------------------------ | ------------------------------------------------------------------------------------------------- | +| **SQL92 Base** | `SqlGeneratorCommon.pqm` | Shared infrastructure: type validation, AST helpers, 40+ function stubs, base SQL92 capabilities | +| **DuckDB Overrides** | `SqlGenerator.pqm` | DuckDB dialect: 24 type facets, LIMIT/OFFSET syntax, function remapping, typed literal generation | +| **Connector Wiring** | `DuckDb.pq` | Creates `SqlView.Generator` instance, wires to `Adbc.Connection` via `GetData` | + +`SqlGenerator.pqm` loads the base via `Extension.LoadExpression()`, defines an override record, and calls `MergeOverrides("Sql92", Override, false)` to produce the final generator. + +**Key DuckDB overrides:** + +- **LIMIT/OFFSET**: Translates M's `Table.FirstN`/`Table.Skip` to `LIMIT n OFFSET m` +- **Function remapping**: `TIMESTAMPADD`/`TIMESTAMPDIFF` to DuckDB's `date_add`/`date_diff`, `Text.PositionOf` to `INSTR`, `Text.StartsWith` to `starts_with` +- **Typed literals**: `DATE '2023-01-01'`, `TIMESTAMP '...'`, `TIME '...'`, `CAST(value AS TYPE)` for numeric/string types +- **Type facets**: 24 DuckDB types with `NativeTypeName`, precision, radix, and scale metadata +- **Supported conversions**: Type casting rules (e.g., `BOOLEAN` to `VARCHAR`/`DECIMAL`/`BIGINT`) + +Partners building new ADBC connectors can use this as a template: copy `SqlGeneratorCommon.pqm` as-is, then create a dialect-specific `SqlGenerator.pqm` with overrides for their database's SQL syntax and type system. + +### Primary & Foreign Keys + +Queries `information_schema.table_constraints` + `key_column_usage` for PKs, applies them via `Type.ReplaceTableKeys`. Exposes `GetForeignKeys()` for FK discovery. Power BI uses these to auto-create relationships. + +## Supported Types + +BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, HUGEINT, FLOAT, DOUBLE, DECIMAL, DATE, TIME, TIMESTAMP, TIMESTAMP WITH TIME ZONE, VARCHAR, CHAR, BLOB, BINARY, UUID, JSON, INTERVAL, ARRAY, STRUCT, MAP + +## Testing + +Tests require a DuckDB FlightSQL server running locally. See [Test Data Setup](Tests/TestSuites/Setup/readme.md) for Docker container setup and data loading instructions. + +- [Running Tests with VS Code](Tests/RunDuckDbTestsWithVSCodeGuide.md) — recommended approach using Test Explorer +- [Running Performance Tests](Tests/RunDuckDbPerfTestsGuide.md) — performance testing with PQPerf + +## Building + +```powershell +dotnet build DuckDb.proj +``` diff --git a/samples/DuckDbFlightSQL/SqlGenerator.pqm b/samples/DuckDbFlightSQL/SqlGenerator.pqm new file mode 100644 index 0000000..b3605ee --- /dev/null +++ b/samples/DuckDbFlightSQL/SqlGenerator.pqm @@ -0,0 +1,495 @@ +// SqlGenerator.pqm — DuckDb-specific SQL generator overrides. +// DuckDb uses standard SQL92 with LIMIT/OFFSET, double-quote identifier quoting, +// and DuckDb-specific function names. +let + TypeInfo = Extension.LoadExpression("TypeInfo.pqm"), + AddUnsignedAttribute = Table.AddColumn(TypeInfo,"UnsignedAttribute",each if [Unsigned] = true then 1 else 0), + SelectTypeInfoColumns = Table.SelectColumns(AddUnsignedAttribute,{"Name","Type","ColumnSize","GetLiteral","Searchable","UnsignedAttribute","NumberPrecisionRadix"}), + SqlGetTypeInfo = Table.RenameColumns(SelectTypeInfoColumns,{{"Name","SqlTypeName"},{"NumberPrecisionRadix","NumericPrecisionRadix"}}), + + SupportedConversions = #table({"FromSqlTypeName","ToSqlTypeNames"}, { + {"BOOLEAN", {"VARCHAR", "DECIMAL", "BIGINT", "INTEGER", "SMALLINT", "TINYINT", "FLOAT", "DOUBLE"}}, + {"TINYINT", {"TINYINT", "SMALLINT", "INTEGER", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "HUGEINT", "VARCHAR"}}, + {"SMALLINT", {"SMALLINT", "INTEGER", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "HUGEINT", "VARCHAR"}}, + {"INTEGER", {"INTEGER", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "HUGEINT", "VARCHAR"}}, + {"INT", {"INT", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "HUGEINT", "VARCHAR"}}, + {"BIGINT", {"BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "HUGEINT", "VARCHAR"}}, + {"HUGEINT", {"HUGEINT", "DOUBLE", "DECIMAL", "VARCHAR"}}, + {"UTINYINT", {"UTINYINT", "USMALLINT", "UINTEGER", "UBIGINT", "SMALLINT", "INTEGER", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "VARCHAR"}}, + {"USMALLINT", {"USMALLINT", "UINTEGER", "UBIGINT", "INTEGER", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "VARCHAR"}}, + {"UINTEGER", {"UINTEGER", "UBIGINT", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "VARCHAR"}}, + {"UBIGINT", {"UBIGINT", "UHUGEINT", "DOUBLE", "DECIMAL", "VARCHAR"}}, + {"UHUGEINT", {"UHUGEINT", "DOUBLE", "DECIMAL", "VARCHAR"}}, + {"FLOAT", {"FLOAT", "DOUBLE", "DECIMAL", "VARCHAR"}}, + {"DOUBLE", {"DOUBLE", "FLOAT", "DECIMAL", "BIGINT", "INTEGER", "VARCHAR"}}, + {"DECIMAL", {"DECIMAL", "DOUBLE", "FLOAT", "BIGINT", "INTEGER", "VARCHAR"}}, + {"DATE", {"DATE", "TIMESTAMP", "VARCHAR"}}, + {"TIME", {"TIME", "VARCHAR"}}, + {"TIMESTAMP", {"TIMESTAMP", "DATE", "TIME", "VARCHAR"}}, + {"TIMESTAMP WITH TIME ZONE", {"TIMESTAMP WITH TIME ZONE", "TIMESTAMP", "DATE", "TIME", "VARCHAR"}}, + {"VARCHAR", {"VARCHAR", "DECIMAL", "BIGINT", "INTEGER", "SMALLINT", "TINYINT", "FLOAT", "DOUBLE", "DATE", "TIME", "TIMESTAMP", "BOOLEAN"}}, + {"CHAR", {"CHAR", "VARCHAR"}}, + {"BLOB", {"BLOB", "VARCHAR"}}, + {"BINARY", {"BINARY", "VARCHAR"}} + }), + SqlTypesCategories = [ + SoftBase2Types = {"DOUBLE", "FLOAT", "DECIMAL", "BIGINT", "INTEGER", "SMALLINT", "TINYINT"}, + SoftBase10Types = {"DECIMAL", "DOUBLE", "FLOAT", "BIGINT", "INTEGER", "SMALLINT", "TINYINT"}, + VarBinaryTypes = {"BLOB"}, WideCharTypes = {"VARCHAR"}, VarCharTypes = {"VARCHAR"}, WideVarCharTypes = {"VARCHAR"} + ], + DefaultTypes = #table({"Type","SqlTypeName"}, { + {Logical.Type, "BOOLEAN"}, {Int8.Type, "TINYINT"}, {Int16.Type, "SMALLINT"}, {Int32.Type, "INTEGER"}, + {Int64.Type, "BIGINT"}, {Single.Type, "FLOAT"}, {Double.Type, "DOUBLE"}, {Decimal.Type, "DECIMAL"}, + {Date.Type, "DATE"}, {Time.Type, "TIME"}, {DateTime.Type, "TIMESTAMP"}, + {DateTimeZone.Type, "TIMESTAMP WITH TIME ZONE"}, {Text.Type, "VARCHAR"}, {Binary.Type, "BLOB"} + }), + Override = [ + SqlGetTypeInfo = SqlGetTypeInfo, + SqlCapabilities = [LimitClauseKind = LimitClauseKind.LimitOffset, FractionalSecondsScale = 6], + TimestampFunctionOverrides = AdbcTimestampFunctionOverrides, + FunctionOverrides = AdbcFunctionOverrides, + BinaryOperatorOverrides = [], UnaryOperatorOverrides = [], + DefaultTypes = DefaultTypes, SupportedConversions = SupportedConversions, SqlTypesCategories = SqlTypesCategories + ], + SqlGenerator = SqlGeneratorHelpers[MergeOverrides]("Sql92",Override,false), + currentAstVisitorRecord = SqlGenerator[AstVisitor], + addToAstVisitor = [ + AstVisitor = currentAstVisitorRecord & [ + LimitClause = (skip, take) => + if skip = 0 and take = null then error "NoopSkipTakeError" + else let + limitPart = if take <> null then Text.Format("LIMIT #{0}", {take}) else "", + offsetPart = if skip <> null and skip > 0 then Text.Format("OFFSET #{0}", {skip}) else "", + delimiter = if limitPart <> "" and offsetPart <> "" then " " else "" + in [Text = limitPart & delimiter & offsetPart, Location = "AfterQuerySpecification"], + Constant = + let + Cast = (value, typeName) => [Text = Text.Format("CAST(#{0} as #{1})", {value, typeName}, "")], + DateFormatted = (value) => [Text = Text.Format("DATE '#{0}'", {Date.ToText(value, "yyyy-MM-dd")})], + TimestampFormatted = (value) => [Text = Text.Format("TIMESTAMP '#{0}'", {DateTime.ToText(value, "yyyy-MM-dd HH:mm:ss.ffffff")})], + TimeFormatted = (value) => [Text = Text.Format("TIME '#{0}'", {Time.ToText(value, "HH:mm:ss.ffffff")})], + Visitor = [ + DECIMAL = each Cast(_, "DECIMAL"), INTEGER = each Cast(_, "INTEGER"), INT = each Cast(_, "INTEGER"), + BIGINT = each Cast(_, "BIGINT"), SMALLINT = each Cast(_, "SMALLINT"), TINYINT = each Cast(_, "TINYINT"), + HUGEINT = each Cast(_, "HUGEINT"), + UTINYINT = each Cast(_, "UTINYINT"), USMALLINT = each Cast(_, "USMALLINT"), + UINTEGER = each Cast(_, "UINTEGER"), UBIGINT = each Cast(_, "UBIGINT"), + UHUGEINT = each Cast(_, "UHUGEINT"), + FLOAT = each Cast(_, "FLOAT"), DOUBLE = each Cast(_, "DOUBLE"), + DATE = each DateFormatted(_), TIMESTAMP = each TimestampFormatted(_), + #"TIMESTAMP WITH TIME ZONE" = each TimestampFormatted(_), TIME = each TimeFormatted(_), + VARCHAR = each [Text = Text.Format("CAST('#{0}' as VARCHAR)", {Text.Replace(_, "'", "''")})], BOOLEAN = each [Text = if _ then "true" else "false"] + ] + in (typeInfo, ast) => Record.FieldOrDefault(Visitor, typeInfo[TYPE_NAME], each null)(ast[Value]) + ] + ], + Extension.LoadExpression = (name as text) => + let binary = Extension.Contents(name), asText = Text.FromBinary(binary) + in Expression.Evaluate(asText, #shared), + SqlGeneratorHelpers = Extension.LoadExpression("SqlGeneratorCommon.pqm"), + AdbcHelpers = SqlGeneratorHelpers[Helpers], + AdbcConstants = SqlGeneratorHelpers[Constants], + funcName = SqlGeneratorHelpers[FunctionNames], + SingleListElement = AdbcHelpers[SingleListElement], InExpression = AdbcHelpers[InExpression], + GetInvocation = AdbcHelpers[GetInvocation], WhenItem = AdbcHelpers[WhenItem], + CaseFunction = AdbcHelpers[CaseFunction], UnaryLogicalOperation = AdbcHelpers[UnaryLogicalOperation], + BinaryLogicalOperation = AdbcHelpers[BinaryLogicalOperation], Argument = AdbcHelpers[Argument], + Function = AdbcHelpers[Function], Literal = AdbcHelpers[Literal], + BinaryOperation = AdbcHelpers[BinaryOperation], Invocation = AdbcHelpers[Invocation], + InvocationWithType = AdbcHelpers[InvocationWithType], InArrayExpression = AdbcHelpers[InArrayExpression], + SqlConstant = AdbcHelpers[SqlConstant], CastSqlExpression = AdbcHelpers[CastSqlExpression], + one = AdbcConstants[one], + minusone = AdbcConstants[minusone], + startOfYearDateTime = AdbcConstants[startOfYearDateTime], + textTypeWithFacets = Type.ReplaceFacets(Text.Type, [NativeTypeName = "VARCHAR"]), + doubleTypeWithFacets = Type.ReplaceFacets(Double.Type, [NativeTypeName = "DOUBLE"]), + decimalTypeWithFacets = Type.ReplaceFacets(Decimal.Type, [NativeTypeName = "DECIMAL"]), + decimalTypeWithPrecision = Type.ReplaceFacets(Decimal.Type, [NativeTypeName = "DECIMAL", NumericPrecisionBase = 10, NumericPrecision = 38, NumericScale = 6]), + integerTypeWithFacets = Type.ReplaceFacets(Number.Type, [NativeTypeName = "INTEGER"]), + bigIntTypeWithFacets = Type.ReplaceFacets(Int64.Type, [NativeTypeName = "BIGINT"]), + datetypewithFacets = Type.ReplaceFacets(Date.Type, [NativeTypeName = "DATE"]), + datetimeTypeWithFacets = Type.ReplaceFacets(DateTime.Type, [NativeTypeName = "TIMESTAMP"]), + epochTimestamp = CastSqlExpression(startOfYearDateTime, datetimeTypeWithFacets), + GetListCount = (listvalue) => if listvalue = null then 0 else List.Count(listvalue), + + TypeFacets = [ + #"VARCHAR" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "VARCHAR"]), + #"CHAR" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "CHAR"]), + #"BOOLEAN" = Type.ReplaceFacets(Logical.Type, [NativeTypeName = "BOOLEAN"]), + #"TINYINT" = Type.ReplaceFacets(Int8.Type, [NativeTypeName = "TINYINT"]), + #"SMALLINT" = Type.ReplaceFacets(Int16.Type, [NativeTypeName = "SMALLINT"]), + #"INTEGER" = Type.ReplaceFacets(Int32.Type, [NativeTypeName = "INTEGER"]), + #"INT" = Type.ReplaceFacets(Int32.Type, [NativeTypeName = "INT"]), + #"BIGINT" = Type.ReplaceFacets(Int64.Type, [NativeTypeName = "BIGINT"]), + #"HUGEINT" = Type.ReplaceFacets(Decimal.Type, [NativeTypeName = "HUGEINT"]), + #"UTINYINT" = Type.ReplaceFacets(Int16.Type, [NativeTypeName = "UTINYINT"]), + #"USMALLINT" = Type.ReplaceFacets(Int32.Type, [NativeTypeName = "USMALLINT"]), + #"UINTEGER" = Type.ReplaceFacets(Int64.Type, [NativeTypeName = "UINTEGER"]), + #"UBIGINT" = Type.ReplaceFacets(Decimal.Type, [NativeTypeName = "UBIGINT"]), + #"UHUGEINT" = Type.ReplaceFacets(Decimal.Type, [NativeTypeName = "UHUGEINT"]), + #"FLOAT" = Type.ReplaceFacets(Single.Type, [NativeTypeName = "FLOAT"]), + #"DOUBLE" = Type.ReplaceFacets(Double.Type, [NativeTypeName = "DOUBLE", NumericPrecisionBase = 2, NumericPrecision = 53]), + #"DECIMAL" = Type.ReplaceFacets(Decimal.Type, [NativeTypeName = "DECIMAL"]), + #"DATE" = Type.ReplaceFacets(Date.Type, [NativeTypeName = "DATE"]), + #"TIME" = Type.ReplaceFacets(Time.Type, [NativeTypeName = "TIME"]), + #"TIMESTAMP" = Type.ReplaceFacets(DateTime.Type, [NativeTypeName = "TIMESTAMP"]), + #"TIMESTAMP WITH TIME ZONE" = Type.ReplaceFacets(DateTimeZone.Type, [NativeTypeName = "TIMESTAMP WITH TIME ZONE"]), + #"BLOB" = Type.ReplaceFacets(Binary.Type, [NativeTypeName = "BLOB"]), + #"BINARY" = Type.ReplaceFacets(Binary.Type, [NativeTypeName = "BINARY"]), + #"UUID" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "UUID"]), + #"JSON" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "JSON"]), + #"INTERVAL" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "INTERVAL"]), + #"ARRAY" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "ARRAY"]), + #"STRUCT" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "STRUCT"]), + #"MAP" = Type.ReplaceFacets(Text.Type, [NativeTypeName = "MAP"]) + ], + + IntFromHelper = (ast, visitor, targetType, castType) => + let + sqlAstArg = visitor(ast[Arguments]{0}), + argCount = GetListCount(ast[Arguments]), + roundingMode = if argCount = 3 then ast[Arguments]{2}[Value] else null, + roundingFunc = + if roundingMode = RoundingMode.Down then "FLOOR" + else if roundingMode = RoundingMode.Up then "CEIL" + else null, + hasRounding = (argCount = 3 and roundingFunc <> null), + isTowardZero = (argCount = 3 and roundingMode = RoundingMode.TowardZero), + isFloatingPoint = (sqlAstArg[Type] = Decimal.Type or sqlAstArg[Type] = Double.Type or sqlAstArg[Type] = Single.Type), + isText = (Type.Is(sqlAstArg[Type], type text) or Type.Is(sqlAstArg[Type], type nullable text)), + result = + // Unsupported rounding modes (AwayFromZero, ToEven) - don't fold + if (argCount = 3 and not hasRounding and not isTowardZero) then + ... + // Non-null culture/format arg - don't fold + else if (argCount >= 2 and ast[Arguments]{1}[Value] <> null) then + ... + // Already target type - passthrough + else if (sqlAstArg[Type] = targetType) then + sqlAstArg + // Rounding with float/double/decimal - apply rounding func then CAST + else if hasRounding and isFloatingPoint then + CastSqlExpression(InvocationWithType({Argument(sqlAstArg, sqlAstArg[Type])}, roundingFunc, castType), castType) + // Rounding with text - CAST to DOUBLE, apply rounding func, then CAST + else if hasRounding and isText then + let + asDouble = CastSqlExpression(sqlAstArg, doubleTypeWithFacets) + in + CastSqlExpression(InvocationWithType({Argument(asDouble, doubleTypeWithFacets)}, roundingFunc, castType), castType) + // TowardZero with text - CAST to DOUBLE first, then to target type + else if isTowardZero and isText then + CastSqlExpression(CastSqlExpression(sqlAstArg, doubleTypeWithFacets), castType) + // Default - simple CAST (covers 1-arg, TowardZero with numeric, integer types, date, etc.) + else + CastSqlExpression(sqlAstArg, castType) + in + result, + + // DuckDB lacks timestampadd/timestampdiff. Remap to date_add/date_diff with INTERVAL syntax. + AdbcTimestampFunctionOverrides = [ + timestampadd = (timestampAst, unitAst, partAst) => + let + part = partAst[Literal], + castUnitAst = CastSqlExpression(unitAst, bigIntTypeWithFacets), + oneInterval = [Kind = "Interval", Interval = [Kind = "Literal", Value = part], Expression = Literal("1")], + scaledInterval = BinaryOperation(castUnitAst, "Multiply", oneInterval), + arguments = {[Expression = timestampAst, Type = timestampAst[Type]], [Expression = scaledInterval, Type = Int64.Type]}, + dateAddResult = [Kind = "Invocation", Function = [Kind = "Function", Name = "date_add"], Arguments = arguments, Type = datetimeTypeWithFacets] + in + CastSqlExpression(dateAddResult, datetimeTypeWithFacets), + timestampdiff = (ast1, ast2, part) => + let + partLiteral = if part[Literal] = "Nanosecond" then "microsecond" else Text.Lower(part[Literal]), + partConst = Literal(partLiteral), + arguments = {[Expression = partConst, Type = Text.Type], [Expression = ast2, Type = ast2[Type]], [Expression = ast1, Type = ast1[Type]]}, + dateDiffResult = [Kind = "Invocation", Function = [Kind = "Function", Name = "date_diff"], Arguments = arguments, Type = Int64.Type] + in + dateDiffResult + ], + + // StartOf: date_diff(part, epoch, col) → count of periods → date_add(epoch, count * interval 1 part) + // Truncates col to the start of the given period. Casts to DATE if input is date type. + DateStartOfHelper = (ast, visitor, datetimepart) => + let + sqlAstCol = visitor(ast[Arguments]{0}), + partLiteral = Literal(datetimepart), + // date_diff(part, epoch, col) → integer number of complete periods + diffArgs = {[Expression = partLiteral, Type = Text.Type], [Expression = epochTimestamp, Type = datetimeTypeWithFacets], [Expression = sqlAstCol, Type = sqlAstCol[Type]]}, + diff = [Kind = "Invocation", Function = [Kind = "Function", Name = "date_diff"], Arguments = diffArgs, Type = Int64.Type], + // CAST(diff AS BIGINT) * interval 1 part + castDiff = CastSqlExpression(diff, bigIntTypeWithFacets), + oneInterval = [Kind = "Interval", Interval = [Kind = "Literal", Value = datetimepart], Expression = Literal("1")], + scaledInterval = BinaryOperation(castDiff, "Multiply", oneInterval), + // date_add(epoch, scaledInterval) + addArgs = {[Expression = epochTimestamp, Type = datetimeTypeWithFacets], [Expression = scaledInterval, Type = Int64.Type]}, + dateAddResult = [Kind = "Invocation", Function = [Kind = "Function", Name = "date_add"], Arguments = addArgs, Type = datetimeTypeWithFacets], + result = if Type.Is(sqlAstCol[Type], type nullable date) then + CastSqlExpression(dateAddResult, datetypewithFacets) + else dateAddResult + in + result, + + // EndOf: same as StartOf but diff+1, then subtract 1 day (date) or 1 second (datetime) + DateEndOfHelper = (ast, visitor, datetimepart) => + let + sqlAstCol = visitor(ast[Arguments]{0}), + isDateType = Type.Is(sqlAstCol[Type], type nullable date), + subtractUnit = if isDateType then "day" else "second", + partLiteral = Literal(datetimepart), + // date_diff(part, epoch, col) + diffArgs = {[Expression = partLiteral, Type = Text.Type], [Expression = epochTimestamp, Type = datetimeTypeWithFacets], [Expression = sqlAstCol, Type = sqlAstCol[Type]]}, + diff = [Kind = "Invocation", Function = [Kind = "Function", Name = "date_diff"], Arguments = diffArgs, Type = Int64.Type], + // CAST(diff + 1 AS BIGINT) * interval 1 part → start of NEXT period + diffPlusOne = BinaryOperation(diff, "Add", one), + castDiffPlusOne = CastSqlExpression(diffPlusOne, bigIntTypeWithFacets), + oneInterval = [Kind = "Interval", Interval = [Kind = "Literal", Value = datetimepart], Expression = Literal("1")], + scaledInterval = BinaryOperation(castDiffPlusOne, "Multiply", oneInterval), + // date_add(epoch, scaledInterval) → start of next period + addArgs = {[Expression = epochTimestamp, Type = datetimeTypeWithFacets], [Expression = scaledInterval, Type = Int64.Type]}, + nextPeriod = [Kind = "Invocation", Function = [Kind = "Function", Name = "date_add"], Arguments = addArgs, Type = datetimeTypeWithFacets], + // nextPeriod - interval 1 subtractUnit + subInterval = [Kind = "Interval", Interval = [Kind = "Literal", Value = subtractUnit], Expression = Literal("1")], + endResult = BinaryOperation(nextPeriod, "Subtract", subInterval), + result = if isDateType then + CastSqlExpression(endResult, datetypewithFacets) + else endResult + in + result, + + // DateAdd: date_add(col, CAST(count * multiplier AS BIGINT) * INTERVAL 1 part) + // Casts result to DATE if input is date type. + DateAddHelper = (ast, visitor, datetimepart, multiplier) => + let + sqlAstCol = visitor(ast[Arguments]{0}), + sqlAstCount = visitor(ast[Arguments]{1}), + scaledCount = if multiplier = 1 then sqlAstCount + else BinaryOperation(sqlAstCount, "Multiply", Literal(Text.From(multiplier))), + castCount = CastSqlExpression(scaledCount, bigIntTypeWithFacets), + oneInterval = [Kind = "Interval", Interval = [Kind = "Literal", Value = datetimepart], Expression = Literal("1")], + scaledInterval = BinaryOperation(castCount, "Multiply", oneInterval), + addArgs = {[Expression = sqlAstCol, Type = sqlAstCol[Type]], [Expression = scaledInterval, Type = Int64.Type]}, + dateAddResult = [Kind = "Invocation", Function = [Kind = "Function", Name = "date_add"], Arguments = addArgs, Type = datetimeTypeWithFacets], + result = if Type.Is(sqlAstCol[Type], type nullable date) then + CastSqlExpression(dateAddResult, datetypewithFacets) + else dateAddResult + in + result, + + // RoundingHelper: propagates visitor (and thus groupKeys) to arguments. + // Without this, simple string overrides for round/ceil/floor don't propagate groupKeys + // to nested aggregate overrides like List.Sum/List.Average. + RoundingHelper = (ast, visitor, roundFunc) => + let + argCount = GetListCount(ast[Arguments]), + sqlexprList = List.Transform(ast[Arguments], (c) => visitor(c)), + resultType = if sqlexprList{0}[Type] = Decimal.Type then decimalTypeWithFacets + else Double.Type + in + if argCount = 1 or (argCount = 2 and Record.HasFields(ast[Arguments]{1}, "Value") and ast[Arguments]{1}[Value] = null) then + InvocationWithType({Argument(sqlexprList{0}, sqlexprList{0}[Type])}, roundFunc, resultType) + else if argCount = 2 and Record.HasFields(ast[Arguments]{1}, "Value") then + InvocationWithType({Argument(sqlexprList{0}, sqlexprList{0}[Type]), Argument(sqlexprList{1}, sqlexprList{1}[Type])}, roundFunc, resultType) + else + ..., + + AdbcFunctionOverrides = [ + Text.Middle = (visitor, rowType, groupKeys, ast) as record => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Text.Middle and (GetListCount(ast[Arguments]) = 2 or GetListCount(ast[Arguments]) = 3) then + let + args = ast[Arguments], + sqlexprList = List.Transform(args, (c) => visitor(c)), + arguments = List.Transform(sqlexprList, each Argument(_, _[Type])), + // M's Text.Middle is 0-based, SQL's SUBSTRING is 1-based + fixedStart = Argument(BinaryOperation(sqlexprList{1}, "Add", one), arguments{1}[Type]), + result = if GetListCount(sqlexprList) = 3 then + if (args{2}[Kind] = "Constant" and Type.Is(Value.Type(args{2}[Value]), type number)) then + InvocationWithType({arguments{0}, fixedStart, arguments{2}}, "SUBSTRING", textTypeWithFacets) + else let + LengthInvocation = InvocationWithType({arguments{0}}, funcName[Length], integerTypeWithFacets), + IfNullSecondArg = BinaryOperation(LengthInvocation, "Subtract", sqlexprList{1}), + IfNull = InvocationWithType({arguments{2}, Argument(IfNullSecondArg, integerTypeWithFacets)}, "IFNULL", integerTypeWithFacets) + in InvocationWithType({arguments{0}, fixedStart, Argument(IfNull, integerTypeWithFacets)}, "SUBSTRING", textTypeWithFacets) + else let + LengthInvocation = InvocationWithType({arguments{0}}, funcName[Length], integerTypeWithFacets), + thirdArgument = BinaryOperation(LengthInvocation, "Subtract", sqlexprList{1}), + allarguments = {arguments{0}, fixedStart, Argument(thirdArgument, integerTypeWithFacets)} + in InvocationWithType(allarguments, "SUBSTRING", textTypeWithFacets) + in result + else ..., + Text.From = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Text.From and GetListCount(ast[Arguments]) = 1 + then CastSqlExpression(visitor(ast[Arguments]{0}), textTypeWithFacets) else ..., + Text.PositionOf = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Text.PositionOf and GetListCount(ast[Arguments]) = 2 then + let + sqlargs = List.Transform(ast[Arguments], (c) => visitor(c)), + InstrFunction = Invocation({Argument(sqlargs{0}, textTypeWithFacets), Argument(sqlargs{1}, textTypeWithFacets)}, "INSTR") + in BinaryOperation(InstrFunction, "Subtract", one) + else ..., + Text.Replace = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Text.Replace and GetListCount(ast[Arguments]) = 3 then + let + sqlexprList = List.Transform(ast[Arguments], (c) => visitor(c)), + arguments = List.Transform(sqlexprList, each Argument(_, _[Type])) + in + InvocationWithType(arguments, funcName[REPLACE], textTypeWithFacets) + else ..., + Text.Contains = [Name = "CONTAINS", Type = Logical.Type], + Text.StartsWith = [Name = "starts_with", Type = Logical.Type], + Text.EndsWith = [Name = "suffix", Type = Logical.Type], + Character.FromNumber = "CHR", + Number.Round = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Number.Round and GetListCount(ast[Arguments]) <= 2 then + RoundingHelper(ast, visitor, funcName[round]) + else ..., + Number.RoundUp = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Number.RoundUp and GetListCount(ast[Arguments]) <= 2 then + RoundingHelper(ast, visitor, funcName[ceil]) + else ..., + Number.RoundDown = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Number.RoundDown and GetListCount(ast[Arguments]) <= 2 then + RoundingHelper(ast, visitor, funcName[floor]) + else ..., + Number.Log10 = "log10", + Number.Log = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Number.Log and GetListCount(ast[Arguments]) >= 1 and GetListCount(ast[Arguments]) <= 2 then + let + sqlAstArg1 = visitor(ast[Arguments]{0}), + sqlAstArg1AsDouble = if sqlAstArg1[Type] = Double.Type then sqlAstArg1 + else CastSqlExpression(sqlAstArg1, doubleTypeWithFacets), + result = if GetListCount(ast[Arguments]) = 1 or (GetListCount(ast[Arguments]) = 2 and Record.HasFields(ast[Arguments]{1}, "Value") and ast[Arguments]{1}[Value] = null) then + InvocationWithType({Argument(sqlAstArg1AsDouble, doubleTypeWithFacets)}, funcName[LN], doubleTypeWithFacets) + else + let + sqlAstArg2 = visitor(ast[Arguments]{1}), + sqlAstArg2AsDouble = if sqlAstArg2[Type] = Double.Type then sqlAstArg2 + else CastSqlExpression(sqlAstArg2, doubleTypeWithFacets) + in + InvocationWithType({Argument(sqlAstArg2AsDouble, doubleTypeWithFacets), Argument(sqlAstArg1AsDouble, doubleTypeWithFacets)}, "log", doubleTypeWithFacets) + in + result + else ..., + Number.Mod = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Number.Mod and GetListCount(ast[Arguments]) = 2 then + let + leftArg = visitor(ast[Arguments]{0}), + rightArg = visitor(ast[Arguments]{1}), + nonIntegerTypes = {Double.Type, Single.Type, Decimal.Type}, + resultType = if List.Contains(nonIntegerTypes, leftArg[Type]) or List.Contains(nonIntegerTypes, rightArg[Type]) then + decimalTypeWithFacets + else + rightArg[Type] + in + InvocationWithType({Argument(leftArg, leftArg[Type]), Argument(rightArg, rightArg[Type])}, "mod", resultType) + else ..., + List.Contains = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = List.Contains and GetListCount(ast[Arguments]) = 2 then + let + arg1 = ast[Arguments]{0}, + result = if arg1[Kind] = "Constant" and Type.Is(Value.Type(arg1[Value]), type list) then + if GetListCount(arg1[Value]) = 1 then SingleListElement(ast, visitor) else InExpression(ast[Arguments], visitor) + else ... + in result + else ..., + List.Sum = (visitor, rowType, groupKeys, ast) => + let + foldedArg = visitor(ast[Arguments]{0}) + in + if ast[Kind] = "Invocation" and + ast[Function][Kind] = "Constant" and + ast[Function][Value] = List.Sum and + groupKeys <> null and + Type.Is(foldedArg[Type], type number) and + (GetListCount(ast[Arguments]) = 1 or + GetListCount(ast[Arguments]) = 2) + then if ((GetListCount(ast[Arguments]) = 1) or + (ast[Arguments]{1}[Kind] = "Constant" + and ast[Arguments]{1}[Value] = Precision.Double)) + then InvocationWithType({Argument(CastSqlExpression(foldedArg, doubleTypeWithFacets), doubleTypeWithFacets)}, "SUM", doubleTypeWithFacets) + else if ((GetListCount(ast[Arguments]) = 2) and (ast[Arguments]{1}[Kind] = "Constant" and ast[Arguments]{1}[Value] = Precision.Decimal)) + then if foldedArg[Type] = Decimal.Type then + InvocationWithType({Argument(foldedArg, foldedArg[Type])}, "SUM", foldedArg[Type]) + else + InvocationWithType({Argument(CastSqlExpression(foldedArg, decimalTypeWithFacets), decimalTypeWithFacets)}, "SUM", decimalTypeWithFacets) + else ... + else ..., + List.Average = (visitor, rowType, groupKeys, ast) => + let + foldedArg = visitor(ast[Arguments]{0}) + in + if ast[Kind] = "Invocation" and + ast[Function][Kind] = "Constant" and + ast[Function][Value] = List.Average and + (GetListCount(ast[Arguments]) = 1 or + GetListCount(ast[Arguments]) = 2) and + groupKeys <> null and + Type.Is(foldedArg[Type], type number) then + if ((GetListCount(ast[Arguments]) = 1) or + (ast[Arguments]{1}[Kind] = "Constant" and ast[Arguments]{1}[Value] = Precision.Double)) then + InvocationWithType({Argument(CastSqlExpression(foldedArg, doubleTypeWithFacets), doubleTypeWithFacets)}, "AVG", doubleTypeWithFacets) + else if (ast[Arguments]{1}[Kind] = "Constant" and ast[Arguments]{1}[Value] = Precision.Decimal) + then if foldedArg[Type] = Decimal.Type then + InvocationWithType({Argument(foldedArg, foldedArg[Type])}, "AVG", foldedArg[Type]) + else + InvocationWithType({Argument(CastSqlExpression(foldedArg, decimalTypeWithFacets), decimalTypeWithFacets)}, "AVG", decimalTypeWithFacets) + else ... + else ..., + List.Max = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 and groupKeys <> null then Invocation({Argument(visitor(ast[Arguments]{0}), null)}, "MAX") else ..., + List.Min = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 and groupKeys <> null then Invocation({Argument(visitor(ast[Arguments]{0}), null)}, "MIN") else ..., + List.Count = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 and groupKeys <> null then InvocationWithType({Argument(one,null)}, "COUNT", integerTypeWithFacets) else ..., + Table.RowCount = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 and groupKeys <> null then InvocationWithType({Argument(one,null)}, "COUNT", integerTypeWithFacets) else ..., + Int32.From = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Int32.From and GetListCount(ast[Arguments]) >= 1 and GetListCount(ast[Arguments]) <= 3 + then IntFromHelper(ast, visitor, Int32.Type, integerTypeWithFacets) + else ..., + Int64.From = (visitor, rowType, groupKeys, ast) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = Int64.From and GetListCount(ast[Arguments]) >= 1 and GetListCount(ast[Arguments]) <= 3 + then IntFromHelper(ast, visitor, Int64.Type, bigIntTypeWithFacets) + else ..., + Double.From = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then CastSqlExpression(visitor(ast[Arguments]{0}), doubleTypeWithFacets) else ..., + Decimal.From = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then CastSqlExpression(visitor(ast[Arguments]{0}), decimalTypeWithPrecision) else ..., + Date.From = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then CastSqlExpression(visitor(ast[Arguments]{0}), datetypewithFacets) else ..., + DateTime.From = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then CastSqlExpression(visitor(ast[Arguments]{0}), datetimeTypeWithFacets) else ..., + Date.StartOfDay = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateStartOfHelper(ast, visitor, "day") else ..., + Date.StartOfMonth = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateStartOfHelper(ast, visitor, "month") else ..., + Date.StartOfQuarter = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateStartOfHelper(ast, visitor, "quarter") else ..., + Date.StartOfYear = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateStartOfHelper(ast, visitor, "year") else ..., + Date.EndOfDay = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateEndOfHelper(ast, visitor, "day") else ..., + Date.EndOfMonth = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateEndOfHelper(ast, visitor, "month") else ..., + Date.EndOfQuarter = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateEndOfHelper(ast, visitor, "quarter") else ..., + Date.EndOfYear = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateEndOfHelper(ast, visitor, "year") else ..., + Time.StartOfHour = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateStartOfHelper(ast, visitor, "hour") else ..., + Time.EndOfHour = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 1 then DateEndOfHelper(ast, visitor, "hour") else ..., + Time.Second = "second", + Date.AddDays = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 2 then DateAddHelper(ast, visitor, "day", 1) else ..., + Date.AddMonths = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 2 then DateAddHelper(ast, visitor, "month", 1) else ..., + Date.AddQuarters = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 2 then DateAddHelper(ast, visitor, "month", 3) else ..., + Date.AddWeeks = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 2 then DateAddHelper(ast, visitor, "day", 7) else ..., + Date.AddYears = (visitor, rowType, groupKeys, ast) => + if GetListCount(ast[Arguments]) = 2 then DateAddHelper(ast, visitor, "year", 1) else ... + ], + FinalSqlGenerator = SqlGenerator & addToAstVisitor +in + [SqlGenerator = FinalSqlGenerator, TypeFacets = TypeFacets] diff --git a/samples/DuckDbFlightSQL/SqlGeneratorCommon.pqm b/samples/DuckDbFlightSQL/SqlGeneratorCommon.pqm new file mode 100644 index 0000000..5686f44 --- /dev/null +++ b/samples/DuckDbFlightSQL/SqlGeneratorCommon.pqm @@ -0,0 +1,704 @@ +// This is SqlGenerator template that will be shared with connector developers. Connector developers will be able to +// use different base configurations, currently only Generators.Sql92.ID configuration is available. +// 1) It has couple of configurations (have details in comments below) which can be overridden +// 2) Helpers to create Sql Ast +// 3) Some Assert functions to validate overrides +// 4) Merge Override function to merge user overrides with SqlGenerator override. +let +// Base SqlGenerator + Implementation = "1.0", +// This is used to convert for the type conversions of the results, if provided then any comparision/operation +// between Type1 and Type2 will result in ResultType +// Table Columns : +// Type1 : TypeValue +// Type2 : TypeValue +// ResultType: TypeValue + ImplicitTypeConversions = null, +//Allows the M engine to select a compatible data type when conversion between two specific numeric types is not declared as supported in the SupportedConversions. +//If true then SqlTypeCategories SoftBase2Types and SoftBase10Types also needs to be provided. + UseSoftNumbers = false, + funcName = [ + year = "year", + month = "month", + dayofmonth = "dayofmonth", + quarter = "quarter", + week = "week", + dayofyear = "dayofyear", + dayofweek = "dayofweek", + ABS = "ABS", + ACOS = "ACOS", + ASIN = "ASIN", + ATAN = "ATAN", + ATAN2 = "ATAN2", + COS = "COS", + EXP = "EXP", + MOD = "MOD", + POWER = "POWER", + SIGN = "SIGN", + SIN = "SIN", + SQRT = "SQRT", + TAN = "TAN", + CONTAINS = "CONTAINS", + StartsWith = "StartsWith", + EndsWith = "EndsWith", + Length = "Length", + LEFT = "LEFT", + RIGHT = "RIGHT", + REPLACE = "REPLACE", + REPEAT = "REPEAT", + LOWER = "LOWER", + UPPER = "UPPER", + LTRIM = "LTRIM", + RTRIM = "RTRIM", + CHAR = "CHAR", + ASCII = "ASCII", + minute = "minute", + hour = "hour", + round = "round", + ceil = "ceil", + floor = "floor", + LN = "LN" + ], +// Constants + minute = Literal("minute"), + second = Literal("second"), + hour = Literal("hour"), + nanosecond = Literal("nanosecond"), + minusone = Literal("-1"), + one = Literal("1"), + zero = Literal("0"), + nanosecondspersecond = Literal("1000000000"), + startOfYearDateTime = SqlConstant("AnsiString","2000-01-01 00:00:00.000",type text), + ticksperday = Literal("864000000000"), + ticksperhour = Literal("36000000000"), + ticksperminute = Literal("600000000"), + tickspersecond = Literal("10000000"), + +//Internal Helpers + SingleListElement = (ast,visitor) => + let + sqlastarg2 = visitor(ast[Arguments]{1}), + array = List.Transform(ast[Arguments]{0}[Value],(c) => [Kind = "Constant", Value = c]), + sqlastarray = List.Transform(array, (c) => visitor(c)), + sqlast = if(ast[Arguments]{0}[Value]{0} = null) then UnaryLogicalOperation("IsNull",sqlastarg2) + else BinaryLogicalOperation("Equals",sqlastarg2,sqlastarray{0}) + in + sqlast, + + InExpression = (args,visitor) => + let + array = List.Transform(args{0}[Value],(c) => [Kind = "Constant", Value = c]), + sqlastarg1 = List.Transform(array, (c) => visitor(c)), + inarrayexpression = InArrayExpression(sqlastarg1), + sqlastarg2 = visitor(args{1}) + in + BinaryLogicalOperation("In",sqlastarg2,inarrayexpression), + +// All Helpers + GetInvocation = (ast, function, count) => + if ast[Kind] = "Invocation" and ast[Function][Kind] = "Constant" and ast[Function][Value] = function and List.Count(ast[Arguments]) = count + then ast[Arguments] + else ..., + ApproxDistinctCount = (list) => [ + Kind = "Invocation", + Function = Function("approx_count_distinct"), + Arguments = List.Transform(list, Argument), Type = Int64.Type + ], + InvocationWithVerbatim = (verbatimPrefix,args,name,Type) => [Kind = "Invocation", Function = [Kind = "Function", Name=name, VerbatimPrefix = verbatimPrefix], Arguments = args, Type = Type], + IntervalExpression = (intervalUnit,expr) => [Kind = "Interval", Interval = [Kind = "Literal", Value = intervalUnit], Expression = expr], + WhenItem = (when,thenItem,Type) => [When = when,Then = thenItem,Type = Type], + CaseFunction = (whenItems,elseItem,case,Type) => [Kind = "Case",Conditions = whenItems,Case = case,Else = elseItem,Type = Type], + ConditionOperation = (operator,left,right) => [Kind = "ConditionOperation",Operator = operator,Left = left,Right = right,Type = Logical.Type], + UnaryLogicalOperation = (operator,expression) => [Kind = "UnaryLogicalOperation",Operator = operator,Expression = expression,Type = Logical.Type ], + BinaryLogicalOperation = (operator,left,right) => [Kind = "BinaryLogicalOperation",Operator = operator,Left =left,Right= right,Type = Logical.Type], + Argument = (expr,Type) => [Expression = expr, Type = Type], + Function = (name) => [Kind = "Function", Name=name], + Literal = (value) => [Kind = "Literal", Value = value], + BinaryOperation = (left, operator, right) => [Kind = "Binary",Left = left,Operator = operator, Right = right, Type = Double.Type ], + Invocation = (args, name) => [Kind = "Invocation", Function = Function(name), Arguments = args, Type = Int64.Type], + InvocationWithType = (args,name,Type) => [Kind = "Invocation", Function = Function(name), Arguments = args, Type = Type], + InArrayExpression = (elements) => [Kind = "InArray",Elements = elements,Type = List.Type], + SqlConstant = (constantType,literal,typeValue) => [Kind = "SqlConstant", ConstantType = constantType,Literal = literal,Type = typeValue], + CastSqlExpression = (SqlAst,Type) => [Kind = "Cast",Expression = SqlAst,Type = Type], + +// These are helper functions to merge base sql generator record with user provided overrides +// If ApplyAssert is false then validations are skipped. It shouldn't be true in Production Code. + MergeOverrides = (generatorId as text, SqlGeneratorOverrides as record,ApplyAssert as logical) => + let + SqlGeneratorBase = SqlGeneratorBaseSettings{[ID = generatorId]}[Settings], + SqlGetTypeInfo = Value.AssertTableType(SqlGeneratorOverrides[SqlGetTypeInfo],SqlGetTypeInfoType,ApplyAssert), + DefaultTypes = if(Record.HasFields(SqlGeneratorOverrides,{"DefaultTypes"})) + then Value.AssertTableType(SqlGeneratorOverrides[DefaultTypes],DefaultTypesType,ApplyAssert) + else null, + TimestampFunctionOverrides = if(Record.HasFields(SqlGeneratorOverrides,{"TimestampFunctionOverrides"})) then Value.AssertRecordType(SqlGeneratorOverrides[TimestampFunctionOverrides],TimestampFunctionOverridesType,2,ApplyAssert) + else null, + SupportedConversions = if(Record.HasFields(SqlGeneratorOverrides,{"SupportedConversions"})) + then Value.AssertTableType(SqlGeneratorOverrides[SupportedConversions],SupportedConversionsType,ApplyAssert) + else null, + SqlTypesCategories = if(Record.HasFields(SqlGeneratorOverrides,{"SqlTypesCategories"})) + then Value.AssertRecordType(SqlGeneratorOverrides[SqlTypesCategories],SqlTypesCategoriesType,2,ApplyAssert) + else null, + withnullcheckSqlCapabilities = SqlGeneratorOverrides[SqlCapabilities]? ?? [], + validatedSqlCapabilitiesOverrides = Value.AssertRecordType(withnullcheckSqlCapabilities,SqlCapabilitiesType,2,ApplyAssert), + mergedSqlCapabilities = MergeSqlCapabilities(SqlGeneratorBase[SqlCapabilities],validatedSqlCapabilitiesOverrides), + SqlCapabilities = Value.AssertRecordType(mergedSqlCapabilities,SqlCapabilitiesType,1,ApplyAssert), + withchecknull = SqlGeneratorOverrides[FunctionOverrides]? ?? [], + validatedfunctionoverrides = Value.AssertRecordType(withchecknull,FunctionOverridesType,1,ApplyAssert), + FunctionOverrides = Value.AssertRecordType(MergeFunctionOverrides(SqlGeneratorBase[AstVisitor][FunctionOverrides],validatedfunctionoverrides),FunctionOverridesType,1,ApplyAssert), + BinaryOperatorOverrides = SqlGeneratorOverrides[BinaryOperatorOverrides]? ?? [], + UnaryOperatorOverrides = SqlGeneratorOverrides[UnaryOperatorOverrides]? ?? [], + ImplicitTypeConversions = SqlGeneratorOverrides[ImplicitTypeConversions]? ?? SqlGeneratorBase[ImplicitTypeConversions], + SoftNumbers = SqlGeneratorOverrides[UseSoftNumbers]? ?? SqlGeneratorBase[SoftNumbers], + AstVisitor = SqlGeneratorBase[AstVisitor] & [FunctionOverrides = FunctionOverrides, BinaryOperatorOverrides = BinaryOperatorOverrides, UnaryOperatorOverrides = UnaryOperatorOverrides], + CombineContext = (left, right) => if left = [] then right else if right = [] then left else null + in + [ + Implementation = SqlGeneratorBase[Implementation], + ImplicitTypeConversions = ImplicitTypeConversions, + SoftNumbers = SoftNumbers, + SqlGetTypeInfo = SqlGetTypeInfo, + SqlCapabilities = SqlCapabilities, + AstVisitor = AstVisitor, + CombineContext = CombineContext, + DefaultTypes = DefaultTypes, + TimestampFunctionOverrides = TimestampFunctionOverrides, + SupportedConversions = SupportedConversions, + SqlTypesCategories = SqlTypesCategories + ], + + MergeSqlCapabilities = (SqlCapabilitiesBase as record, SqlCapabilitiesOverrides as record) => + let +// Sql Capabilities merge + fields = Record.FieldNames(SqlCapabilitiesOverrides), + listOfFieldValues = List.Transform(fields,each TransformFunction(_,SqlCapabilitiesOverrides,SqlCapabilitiesBase)), + TransformFunction = (fieldName as text,override as record, base as record) => + if(Type.Is(Value.Type(Record.Field(override,fieldName)),type record)) + then Record.AddField([],fieldName,Record.Field(base,fieldName) & Record.Field(override,fieldName)) + else Record.AddField([],fieldName,Record.Field(override,fieldName)) + in + SqlCapabilitiesBase & Record.Combine(listOfFieldValues), + MergeFunctionOverrides = (base as record, overrides as record) => + let + FunctionOverrides = if(overrides = null) then [] else overrides + in + if(overrides = []) then base else base & FunctionOverrides, + +// #SqlGeneratorTypes +// Types for SqlCapabilities + SupportedPredicatesType = type [ IsNull = logical,IsNotNull = logical,SupportsComparision = logical], + SupportedSql92RelationalJoinOperatorsType = type [ FullOuterJoin = logical,LeftOuterJoin = logical,RightOuterJoin = logical, + InnerJoin = logical,CrossJoin = logical + ], + TimeStampIntervalValuesType = type nullable [ + Nanosecond = text, + Microsecond = text, + Second = text, + Minute = text, + Hour = text, + Day = text, + Week = text, + Month = text, + Quarter = text, + Year = text + ], + SqlCapabilitiesType = type [ + LimitClauseKind = number, + FractionalSecondsScale = number, + SupportsBindParameters = logical, + IdentifierQuoteChar = nullable text, + CatalogNameSeparator = nullable text, + CatalogNameLocation = nullable number, + Sql92Conformance = nullable number, + MaxColumnsInOrderBy = nullable number, + MaxIdentifierNameLength = nullable number, + OrderByColumnsInSelect = nullable logical, + TolerateConcatOverflow = logical, + SupportedPredicates = SupportedPredicatesType, + SupportedSql92RelationalJoinOperators = SupportedSql92RelationalJoinOperatorsType, + TimeStampIntervalValues = TimeStampIntervalValuesType, + SupportsColumnAliases = logical, + MaxColumnsInGroupBy = number, + MaxColumnsInSelect = number, + GroupByCapabilities = number, + StringConcatNullBehavior = number, + SearchPatternEscapeCharacter = text, + SupportsCastFunction = logical, + IdentifierSpecialCharacters = nullable text + ], + SqlGetTypeInfoType = Value.Type(SqlGetTypeInfo), + DefaultTypesType = Value.Type(DefaultTypes), + TimestampFunctionOverridesType = Value.Type(TimestampFunctionOverrides), + SupportedConversionsType = Value.Type(SupportedConversions), + SqlTypesCategoriesType = type [ + SoftBase2Types = nullable list, + SoftBase10Types = nullable list, + VarBinaryTypes = nullable list, + WideCharTypes = nullable list, + VarCharTypes = nullable list, + WideVarCharTypes = nullable list + ], + FunctionOverridesType = type [ + Date.Year = nullable text, + Date.Month = nullable text, + Date.Day = nullable text, + Date.QuarterOfYear = nullable text, + Date.WeekOfYear = nullable text, + Date.DayOfYear = nullable text, + Date.DayOfWeek = nullable text, + Number.Abs = nullable text, + Number.Acos = nullable text, + Number.Asin = nullable text, + Number.Atan = nullable text, + Number.Atan2 = nullable text, + Number.Cos = nullable text, + Number.Exp = nullable text, + Number.Mod = nullable text, + Number.Power = nullable text, + Number.Sign = nullable text, + Number.Sin = nullable text, + Number.Sqrt = nullable text, + Number.Tan = nullable text, + Text.Contains = record, + Text.StartsWith = nullable text, + Text.EndsWith = nullable text, + Text.Length = nullable text, + Text.Start = nullable text, + Text.End = nullable text, + Text.Replace = nullable text, + Text.Repeat = nullable text, + Text.Lower = nullable text, + Text.Upper = nullable text, + Text.TrimStart = nullable text, + Text.TrimEnd = nullable text, + Character.FromNumber = nullable text, + Character.ToNumber = nullable text, + Time.Minute = nullable text, + Time.Hour = nullable text, + Number.Round = nullable text, + Number.RoundUp = nullable text, + Number.RoundDown = nullable text, + Number.Log = nullable text, + Value.NullableEquals = nullable text, + Value.Equals = nullable text + ] meta [recordtype = "FunctionOverrides"], + + ComplexFunctionOverridesType = Type.ForFunction([ReturnType = type record, Parameters = [visitor = type function,rowType = type record,groupKeys = type list, ast = type record]], 5), + + Value.AssertRecordType = (value as record,valuetype as type, validationtype as number,ApplyAssert as logical) => + if(ApplyAssert = false) then value + else if(Type.Is(valuetype,type record)<> true) then error "Type provided is not a record type" + else if(Value.Metadata(valuetype)[recordtype]? = "FunctionOverrides") then Value.AssertFunctionOverrides(value,valuetype) + else if(validationtype = 1) then Value.HardValidation(value,valuetype) + else if(validationtype = 2) then Value.SoftValidation(value,valuetype) + else error "validationType is not correct", + + Value.AssertTableType = (value as table,tabletype as type,ApplyAssert as logical) => + let + rows= Table.ToRows(value), + fieldnamesfromvalue = Table.Column(Table.Schema(value),"Name"), + fieldnamesfromtype = Table.Column(Type.TableSchema(tabletype),"Name"), + validatecolumncount = if(List.Count(fieldnamesfromvalue) = List.Count(fieldnamesfromtype)) + then rows else error "Column counts do not match between table value and table type provided", + validatedcolumnames = if(List.MatchesAll(fieldnamesfromvalue, each fieldnamesfromtype{List.PositionOf(fieldnamesfromvalue,_)} = _)) + then validatecolumncount else error "Column names of the table value doesnt match with table type provided", + validatedatatypes = List.Transform(validatedcolumnames,each validatetablerows(_)), + validatetablerows = (row as list) => + let + rowrecord = Record.FromList(row,fieldnamesfromtype), + result = List.Transform(fieldnamesfromtype,each validatecell(_)), + validatecell = (fieldname as text) => + let + value = if(Record.HasFields(rowrecord,fieldname)) then Record.Field(rowrecord,fieldname) else error Text.Format("table column #{0} is missing",{fieldname}), + result = if(Type.Is(Value.Type(value),Type.TableColumn(tabletype,fieldname))) then true else error Text.Format("table column #{0} type mismatch",{fieldname}) + in + result + in + List.AllTrue(result) + in + if (ApplyAssert = false) then value + else if(List.AllTrue(validatedatatypes)) then value + else error "There should already have been error message", + +// These all are internal functions used for validation + Value.AssertFunctionType = (functionvalue as function, functiontype as type) => + let + parametersfromvalue = Type.FunctionParameters(Value.Type(functionvalue)), + returnfromvalue = Type.FunctionReturn(Value.Type(functionvalue)), + parametersfromtype = Type.FunctionParameters(functiontype), + returnfromtype = Type.FunctionReturn(functiontype), + returnValidated = if(Type.Is(returnfromvalue,returnfromtype)or Type.Is(type any, returnfromvalue)) + then true + else error "return for the function doesnt match with type", + parameternamesfromvalue = Record.FieldNames(parametersfromvalue), + parameternamesfromtype = Record.FieldNames(parametersfromtype), + validateparametercount = if(List.Count(parameternamesfromvalue) = List.Count(parameternamesfromtype)) + then true + else error "Number of parameters in function doesn't match with number of parameters in type", + validatedparameternames = if(List.MatchesAll(parameternamesfromvalue, each parameternamesfromtype{List.PositionOf(parameternamesfromvalue,_)} = _)) + then true + else error "parameter names for the function signature doesn't match with type", + validateparametertypes = List.AllTrue(List.Transform(parameternamesfromvalue,each + if(Type.Is(Record.Field(parametersfromvalue,_),Record.Field(parametersfromtype,_)) + or Type.Is(type any,Record.Field(parametersfromvalue,_))) + then true + else error Text.Format("Function parameter #{0} type doesn't match function signature type",{_}))) + in + List.AllTrue({returnValidated,validateparametercount,validateparametertypes}), + + Value.AssertFunctionOverrides = (value as record, valuetype as type) => + let + fieldnames = Record.FieldNames(value), + result = List.Transform(fieldnames, each validatefield(_)), + validatefield = (fieldname as text) => + let + fieldvalue = Record.Field(value,fieldname), + result = try if((Type.Is(Value.Type(fieldvalue),type text) or fieldvalue = null) + or (Type.Is(Value.Type(fieldvalue),type record))) + then Value.ValidateTextForFunctionOverrides(fieldname) + else if (Type.Is(Value.Type(fieldvalue),type function)) then Value.AssertFunctionType(fieldvalue,ComplexFunctionOverridesType) + else error Text.Format("#{0} doesn't have a valid type, Functionoverrides can have only functions and text as a value",{fieldname}) + in + if(result[HasError]) then error result[Error] else true + in + if(List.AllTrue(result)) then value + else error "There is an error which should already have been shown", + + Value.ValidateTextForFunctionOverrides = (fieldname as text) => + let + typefields = Type.RecordFields(FunctionOverridesType) + in + if(Record.HasFields(typefields,fieldname)) then true + else error Text.Format("Simple Overrides can only be provided to functions for which there is already a simple function override in base SqlGenerator + , #{0} function is not a simple override in base sql generator",{fieldname}), + + Value.SoftValidation = (value as record, valuetype as type) => + if( Value.FieldByFieldValidation(value,valuetype,2)) then value else error "There is an error which should already have been shown", +// Value.FieldByFieldValidation(value,valuetype,2), + + Value.HardValidation = (value as record, valuetype as type) => + if(Record.FieldCount(value) <> Record.FieldCount(Type.RecordFields(valuetype))) + then error [ Reason = "FileNotFound", + Message = "Field Count doesnt match with type" + ] + else if(Type.Is(valuetype,type record) <> true) then error "Type passed for validation is not record type" + else if(Value.FieldByFieldValidation(value,valuetype,1)) then value + else error "There is an error which should already have been shown", + + Value.FieldByFieldValidation = (value as record, valuetype as type, validationtype as number) => + let + validatedfields = List.Transform(Record.FieldNames(value),each ValidateField(_,value,valuetype,validationtype)) + in + List.AllTrue(validatedfields), + +// validatedfields, + ValidateField = (fieldname as text, value as record, valuetype as type,validationtype as number) => + let + typefields = Type.RecordFields(valuetype), + fieldtype = if(Record.HasFields(typefields,fieldname)) + then Record.Field(typefields,fieldname)[Type] + else error Text.Format("Field #{0} is not a valid field in provided type",{fieldname}), + fieldvalue = Record.Field(value,fieldname), + checkforRecord = try if(Type.Is(Value.Type(fieldvalue),type record)) then Value.AssertRecordType(fieldvalue,fieldtype,validationtype) + else if (Type.Is(Value.Type(fieldvalue),type table)) then Value.AssertTableType(fieldvalue,fieldtype) + else if (Type.Is(Value.Type(fieldvalue),type function)) then Value.AssertFunctionType(fieldvalue,fieldtype) + else if (Type.Is(Value.Type(Record.Field(value,fieldname)),fieldtype)) then true + else error Text.Format("Invalid fieldtype for #{0}",{fieldname}) + in + if(checkforRecord[HasError]) then error checkforRecord[Error] else true, + + SqlGetTypeInfo = #table(type table [SqlTypeName = text, Type = type, ColumnSize = number, GetLiteral = nullable function,Searchable = number,UnsignedAttribute = nullable number,NumericPrecisionRadix = nullable number],{}), + SqlCapabilities = [ + // LimitClause kind supported by DataSource + // Possible Values are : + // LimitClauseKind.None + // LimitClauseKind.Top + // LimitClauseKind.LimitOffset + // LimitClauseKind.Limit + // LimitClauseKind.AnsiSql2008 + LimitClauseKind = LimitClauseKind.None, + // Fractional second scale supported for time values in datasource. For example value of 9 means ss.fffffffff (fractional second value till 9 decimal is supported) + FractionalSecondsScale = 9, + // DataSource supports bind parameters. Valid values are true or false + SupportsBindParameters = false, + // The character string that is used as the starting and ending delimiter of a quoted (delimited) + // identifier in SQL statements. + IdentifierQuoteChar = """" , + // A character string: the character or characters that the data source defines as the separator + // between a catalog name and the qualified name element that follows or precedes it.If null value provided + // then it defaults to "." + CatalogNameSeparator = "." , + // An integer value that indicates the position of the catalog in a qualified table name + // Possible values are : + // 0 ---> Datasource doesn't support catalog name. + // 1 ---> catalog name is at the start of the table name, as in \EMPDATA\EMP.DBF. + // 2 ---> catalog is at the end of the table name, as in ADMIN.EMP@EMPDATA. + // null ---> Defaults to 1 + CatalogNameLocation = 1 , + // An integer value that indicates the level of SQL-92 supported by the driver: + // Possible values are : + // 1 ---> Entry level SQL-92 compliant. + // 2 ---> FIPS 127-2 transitional level compliant. + // 4 ---> Intermediate level SQL-92 compliant. + // 8 ---> Full level SQL-92 compliant. + // null ---> Defaults to 4 + Sql92Conformance = 4 , + // An integer Value that specifies the maximum number of columns allowed in an ORDER BY clause. + // If there is no specified limit or the limit is unknown, this value is set to zero. + // If null value is provided or value not provided then it defaults to 15 + MaxColumnsInOrderBy = 65535 , + // An integer that indicates the maximum size in characters that the data source supports for user-defined names. + // If null then defaults to 128 + MaxIdentifierNameLength = 255 , + // true if the columns in the ORDER BY clause must be in the select list; otherwise, false. + // if null then defaults to true + OrderByColumnsInSelect = false , + // This is set to true when trying to tolerate concatenation overflows. It is used along with SqlTypesCategories + // VarBinaryTypes , WideCharTypes , VarCharTypes , WideVarCharTypes + TolerateConcatOverflow = true, + // This record determines which Sql predicate Functions are supported + SupportedPredicates = [ + IsNull = true, + IsNotNull = false, + SupportsComparision = true + ], + // This record is to configure which Sql relational join operators are supported + SupportedSql92RelationalJoinOperators = [ + FullOuterJoin = true, + LeftOuterJoin = true, + RightOuterJoin = true, + InnerJoin = true, + CrossJoin = true + ], + // true if the data source supports column aliases; otherwise, false. + SupportsColumnAliases = true , + // An integer value that specifies the maximum number of columns allowed in a GROUP BY clause. + // If there is no specified limit or the limit is unknown, this value is set to zero. + MaxColumnsInGroupBy = 65535 , + // An integer value that specifies the maximum number of columns allowed in a select list. + // If there is no specified limit or the limit is unknown, this value is set to zero. + MaxColumnsInSelect = 65535 , + // An integer value that specifies the relationship between the columns in the GROUP BY clause + // and the nonaggregated columns in the select list: + // Possible values are : + // 0 ---> A COLLATE clause can be specified at the end of each grouping column. + // 1 ---> GROUP BY clauses are not supported. + // 2 ---> The GROUP BY clause must contain all nonaggregated columns in the select list. + // It cannot contain any other columns. For example, SELECT DEPT, MAX(SALARY) FROM EMPLOYEE GROUP BY DEPT. + // 3 ---> The GROUP BY clause must contain all nonaggregated columns in the select list. It can contain columns + // that are not in the select list. For example, SELECT DEPT, MAX(SALARY) FROM EMPLOYEE GROUP BY DEPT, AGE. + // 4 ---> The columns in the GROUP BY clause and the select list are not related. The meaning of nongrouped, + // nonaggregated columns in the select list is data source-dependent. For example, SELECT DEPT, SALARY + // FROM EMPLOYEE GROUP BY DEPT, AGE. + GroupByCapabilities = 2 , + // TimeStampInterval Values supported by datasource + TimeStampIntervalValues = [ + Nanosecond = "nanosecond", + Microsecond = "microsecond", + Second = "second", + Minute = "minute", + Hour = "hour", + Day = "day", + Week = "week", + Month = "month", + Quarter = "quarter", + Year = "year" + ], + // This value indicates how the data source handles the concatenation of NULL valued character data type columns with non-NULL valued character data type columns. + // Possible values are : + // 0 ---> Result is NULL valued. + // 1 ---> Result is concatenation of non-NULL valued column or columns. + StringConcatNullBehavior = 0 , + // A character string specifying what driver supports as an escape character that allows the use of the pattern match metacharacters underscore (_) and percent sign (%) + // as valid characters in search patterns. This escape character applies only for those catalog function arguments that support search strings. If this string is empty, + // the driver does not support a search-pattern escape character. + SearchPatternEscapeCharacter = "\" , + // Supports Cast Function + SupportsCastFunction = true, + // A character string that contains all special characters (that is, all characters except a through z, A through Z, 0 through 9, and underscore) + // that can be used in an identifier name, such as a table name, column name, or index name, on the data source. + // For example, "#$^". If an identifier contains one or more of these characters, the identifier must be a delimited identifier. + IdentifierSpecialCharacters = "" + ], + + FunctionOverrides = [ + // Simple Function Overrides + Date.Year = funcName[year], // year([DateColumn]) + Date.Month = funcName[month], // month(DateColumn]) + Date.Day = funcName[dayofmonth], // dayofmonth([DateColumn]) + Date.QuarterOfYear = funcName[quarter], // quarter([DateColumn]) + Date.WeekOfYear = funcName[week], // week([DateColumn]) + Date.DayOfYear = funcName[dayofyear], // dayofyear([DateColumn]) + Date.DayOfWeek = funcName[dayofweek], // dayofweek([DateColumn]) + Number.Abs = funcName[ABS], // ABS([NumberColumn]) + Number.Acos = funcName[ACOS], // ACOS([NumberColumn]) + Number.Asin = funcName[ASIN], // ASIN([NumberColumn]) + Number.Atan = funcName[ATAN], // ATAN([NumberColumn]) + Number.Atan2 = funcName[ATAN2], // ATAN2([NumberColumn]) + Number.Cos = funcName[COS], // COS([NumberColumn]) + Number.Exp = funcName[EXP], // EXP([NumberColumn]) + Number.Mod = funcName[MOD], // MOD(INT1,INT2) + Number.Power = funcName[POWER], // POWER([NumberColumn]) + Number.Sign = funcName[SIGN], // SIGN([NumberColumn]) + Number.Sin = funcName[SIN], // SIN([NumberColumn]) + Number.Sqrt = funcName[SQRT], // SQRT([NumberColumn]) + Number.Tan = funcName[TAN], // TAN([NumberColumn]) + Text.Contains = [Name = funcName[CONTAINS],Type = Logical.Type], // CONTAINS([STRINGCOLUMN],"texttocheck") + Text.StartsWith = [Name = funcName[StartsWith],Type = Logical.Type], // StartsWith([STRINGCOLUMN],"substring") + Text.EndsWith = [Name = funcName[EndsWith],Type = Logical.Type], // EndsWith([STRINGCOLUMN],"substring") + Text.Length = funcName[Length], // Length([STRINGCOLUMN]) + Text.Start = funcName[LEFT], // LEFT([STRINGCOLUMN],count) + Text.End = funcName[RIGHT], // RIGHT([STRINGCOLUMN],count) + Text.Replace = funcName[REPLACE], // REPLACE([STRINGCOLUMN],"oldtext","newtext") + Text.Repeat = funcName[REPEAT], // REPEAT([STRINGCOLUMN],repeatcount) + Text.Lower = funcName[LOWER], // LOWER([STRINGCOLUMN]) + Text.Upper = funcName[UPPER], // UPPER([STRINGCOLUMN]) + Text.TrimStart = funcName[LTRIM], // LTRIM([STRINGCOLUMN]) + Text.TrimEnd = funcName[RTRIM], // RTRIM([STRINGCOLUMN]) + Character.FromNumber = funcName[CHAR], // CHAR([NumberColumn]) + Character.ToNumber = funcName[ASCII], // ASCII([STRINGCOLUMN]) + Time.Minute = funcName[minute], // minute([timecolumn]) + Time.Hour = funcName[hour], // hour([timecolumn]) + Number.Round = funcName[round], // round([numbercolumn]) + Number.RoundUp = funcName[ceil], // ceil([numbercolumn]) + Number.RoundDown = funcName[floor], // floor([numbercolumn]) + Number.Log = funcName[LN], // LN([numbercolumn]) + Value.Equals = null, + Value.NullableEquals = null, + + List.Contains = (visitor, rowType, groupKeys, ast) => + if List.Count(ast[Arguments]) = 2 then + let + arg1 = ast[Arguments]{0}, + arg2 = ast[Arguments]{1}, + sqlAstArg2 = visitor(arg2), + withNullRemoved = List.RemoveNulls(arg1[Value]), + countAfterNullRemoved = List.Count(withNullRemoved), + hasNull = List.Count(arg1[Value]) <> countAfterNullRemoved, + valueEqualsTo = BinaryLogicalOperation("Equals",sqlAstArg2,visitor([Kind = "Constant", Value = withNullRemoved{0}])), + isNull = UnaryLogicalOperation("IsNull",sqlAstArg2), + result = if(arg1[Kind] = "Constant" and Type.Is(Value.Type(arg1[Value]),type list)) + then + let + result = if(countAfterNullRemoved = 1) + then + if hasNull then ConditionOperation("Or",valueEqualsTo,isNull) else valueEqualsTo + else + if (hasNull and (countAfterNullRemoved = 0)) + then isNull + else + let + inExpression = InExpression({[Kind = "Constant", Value = withNullRemoved],ast[Arguments]{1}},visitor), + result = if hasNull then ConditionOperation("Or",inExpression,isNull) else inExpression + in + result + in + result + else ... + in + result + else ... + ], + + DefaultTypes = #table(type table [Type = type,SqlTypeName = text],{}), + + TimestampFunctionOverrides = [timestampadd = null, timestampdiff = null], + + SupportedConversions = #table(type table [FromSqlTypeName = text, ToSqlTypeNames = list ],{}), + + SqlTypesCategories = [ + SoftBase2Types = null, + SoftBase10Types = null, + VarBinaryTypes = null, + WideCharTypes = null, + VarCharTypes = null, + WideVarCharTypes = null + ], + + BinaryOperatorOverrides = [], + UnaryOperatorOverrides = [], + + SqlGeneratorBase = [ + Implementation = Implementation, + SoftNumbers = UseSoftNumbers, + ImplicitTypeConversions = ImplicitTypeConversions, + SqlGetTypeInfo = SqlGetTypeInfo, + AstVisitor = [] + ], + + SqlGenerator92Standard = [ + Implementation = Implementation, + ImplicitTypeConversions = ImplicitTypeConversions, + SoftNumbers = UseSoftNumbers, + SqlGetTypeInfo = SqlGetTypeInfo, + SqlCapabilities = SqlCapabilities, + AstVisitor = [ + FunctionOverrides = FunctionOverrides, + BinaryOperatorOverrides = BinaryOperatorOverrides, + UnaryOperatorOverrides = UnaryOperatorOverrides + ], + DefaultTypes = DefaultTypes, + TimestampFunctionOverrides = TimestampFunctionOverrides, + SupportedConversions = SupportedConversions, + SqlTypesCategories = SqlTypesCategories + ], + + Generators.Sql92.ID = "Sql92", + SqlGeneratorBaseSettings = #table({"ID", "Settings"}, { + {Generators.Sql92.ID, SqlGenerator92Standard} + }) +in + [ + MergeOverrides = MergeOverrides, + Value.AssertRecordType = Value.AssertRecordType, + Value.AssertTableType = Value.AssertTableType, + AllTypes = [ + SupportedPredicatesType = SupportedPredicatesType, + SupportedSql92RelationalJoinOperatorsType = SupportedSql92RelationalJoinOperatorsType, + TimeStampIntervalValuesType = TimeStampIntervalValuesType, + SqlCapabilitiesType = SqlCapabilitiesType, + SqlGetTypeInfoType = SqlGetTypeInfoType, + FunctionOverridesType = FunctionOverridesType, + DefaultTypesType = DefaultTypesType, + TimestampFunctionOverridesType = TimestampFunctionOverridesType, + SqlTypesCategoriesType = SqlTypesCategoriesType, + SupportedConversions = SupportedConversionsType + ], + Constants = [ + minute = minute, + second = second, + hour = hour, + nanosecond = nanosecond, + minusone = minusone, + one = one, + zero = zero, + startOfYearDateTime = startOfYearDateTime, + ticksperday = ticksperday, + tickspersecond = tickspersecond, + ticksperminute = ticksperminute, + ticksperhour = ticksperhour, + nanosecondspersecond = nanosecondspersecond + ], + Helpers = [ + SingleListElement = SingleListElement, + InExpression = InExpression, + GetInvocation = GetInvocation, + ApproxDistinctCount = ApproxDistinctCount, + InvocationWithVerbatim = InvocationWithVerbatim, + WhenItem = WhenItem, + CaseFunction = CaseFunction, + ConditionOperation = ConditionOperation, + UnaryLogicalOperation = UnaryLogicalOperation, + BinaryLogicalOperation = BinaryLogicalOperation, + Argument = Argument, + Function = Function, + Literal = Literal, + BinaryOperation = BinaryOperation, + Invocation = Invocation, + InvocationWithType = InvocationWithType, + InArrayExpression = InArrayExpression, + SqlConstant = SqlConstant, + CastSqlExpression = CastSqlExpression, + IntervalExpression = IntervalExpression + ], + FunctionNames = funcName + ] diff --git a/samples/DuckDbFlightSQL/Tests/Credentials/duckdb_cred.json b/samples/DuckDbFlightSQL/Tests/Credentials/duckdb_cred.json new file mode 100644 index 0000000..a83334d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Credentials/duckdb_cred.json @@ -0,0 +1,10 @@ +{ + "_comment": "Test fixture: dummy credentials for local SQLFlite Docker container", + "AuthenticationKind": "UsernamePassword", + "AuthenticationProperties": { + "Username": "sqlflite_username", + "Password": "sqlflite_password" + }, + "QueryFile": "../ParameterQueries/DuckDb.parameterquery.pq", + "Extension": "../../bin/AnyCPU/Debug/DuckDb.mez" +} diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypes.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypes.adbc.diagnostics new file mode 100644 index 0000000..ef26d2a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypes.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesRowCount.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesRowCount.adbc.diagnostics new file mode 100644 index 0000000..8ba8843 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesRowCount.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"RecordID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesSchema.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesSchema.adbc.diagnostics new file mode 100644 index 0000000..d80dc56 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesSchema.adbc.diagnostics @@ -0,0 +1,17 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZone.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZone.adbc.diagnostics new file mode 100644 index 0000000..a1edf6b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZone.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZoneRowCount.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZoneRowCount.adbc.diagnostics new file mode 100644 index 0000000..a1edf6b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZoneRowCount.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZoneSchema.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZoneSchema.adbc.diagnostics new file mode 100644 index 0000000..c36d3dd --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/AllTypesZoneSchema.adbc.diagnostics @@ -0,0 +1,17 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateType.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateType.adbc.diagnostics new file mode 100644 index 0000000..a857489 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateType.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateTypeRowCount.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateTypeRowCount.adbc.diagnostics new file mode 100644 index 0000000..f6c97cf --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateTypeRowCount.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select COUNT(1) as \"C1\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateTypeSchema.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateTypeSchema.adbc.diagnostics new file mode 100644 index 0000000..fd54f11 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Sanity/DateTypeSchema.adbc.diagnostics @@ -0,0 +1,17 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AddColumnSpecialCharacters.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AddColumnSpecialCharacters.adbc.diagnostics new file mode 100644 index 0000000..1a8d433 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AddColumnSpecialCharacters.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select CAST(' \u0000' as VARCHAR) as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + }, + { + "Command": "select CAST(' \u0000' as VARCHAR) as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AddColumnWithTextStartsWith.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AddColumnWithTextStartsWith.adbc.diagnostics new file mode 100644 index 0000000..9c2a2bc --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AddColumnWithTextStartsWith.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\", starts_with(\"Zone\", CAST('West' as VARCHAR)) as \"C1\" from \"main\".\"TaxiZoneLookup\" where \"Zone\" = CAST('Westchester Village/Unionport' as VARCHAR) and not \"Zone\" is null" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AlltypesNativeQuery.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AlltypesNativeQuery.adbc.diagnostics new file mode 100644 index 0000000..ef26d2a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/AlltypesNativeQuery.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic.adbc.diagnostics new file mode 100644 index 0000000..eee9d11 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\", \"C2\", \"C3\", \"C4\", \"C5\", \"C6\", \"C7\", \"C8\" from ( select \"PULocationID\", \"fare_amount\", cast(\"PULocationID\" as DOUBLE) + CAST(90 as DOUBLE) as \"C1\", cast(\"PULocationID\" as DOUBLE) - CAST(90 as DOUBLE) as \"C2\", cast(\"PULocationID\" as DOUBLE) * CAST(90 as DOUBLE) as \"C3\", round(cast(\"PULocationID\" as DOUBLE) / CAST(90 as DOUBLE), CAST(8 as INTEGER)) as \"C4\", cast(\"fare_amount\" as DOUBLE) + CAST(90 as DOUBLE) as \"C5\", cast(\"fare_amount\" as DOUBLE) - CAST(90 as DOUBLE) as \"C6\", round(cast(\"fare_amount\" as DOUBLE) * CAST(90 as DOUBLE), CAST(8 as INTEGER)) as \"C7\", round(cast(\"fare_amount\" as DOUBLE) / CAST(90 as DOUBLE), CAST(8 as INTEGER)) as \"C8\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_AdditionFloat.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_AdditionFloat.adbc.diagnostics new file mode 100644 index 0000000..bce134e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_AdditionFloat.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"fare_amount\", cast(\"fare_amount\" as DOUBLE) + CAST(90 as DOUBLE) as \"C1\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_AdditionInteger.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_AdditionInteger.adbc.diagnostics new file mode 100644 index 0000000..dcd7150 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_AdditionInteger.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", cast(\"PULocationID\" as DOUBLE) + CAST(90 as DOUBLE) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_DivisionFloat.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_DivisionFloat.adbc.diagnostics new file mode 100644 index 0000000..97f8c03 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_DivisionFloat.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"fare_amount\", round(cast(\"fare_amount\" as DOUBLE) / CAST(90 as DOUBLE), CAST(8 as INTEGER)) as \"C1\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_DivisionInteger.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_DivisionInteger.adbc.diagnostics new file mode 100644 index 0000000..769adae --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_DivisionInteger.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", round(cast(\"PULocationID\" as DOUBLE) / CAST(90 as DOUBLE), CAST(8 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_MultiplicationFloat.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_MultiplicationFloat.adbc.diagnostics new file mode 100644 index 0000000..64de725 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_MultiplicationFloat.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"fare_amount\", round(cast(\"fare_amount\" as DOUBLE) * CAST(90 as DOUBLE), CAST(8 as INTEGER)) as \"C1\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_MultiplicationInteger.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_MultiplicationInteger.adbc.diagnostics new file mode 100644 index 0000000..1fbae56 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_MultiplicationInteger.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", cast(\"PULocationID\" as DOUBLE) * CAST(90 as DOUBLE) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_SubtractionFloat.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_SubtractionFloat.adbc.diagnostics new file mode 100644 index 0000000..eae6272 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_SubtractionFloat.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"fare_amount\", cast(\"fare_amount\" as DOUBLE) - CAST(90 as DOUBLE) as \"C1\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_SubtractionInteger.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_SubtractionInteger.adbc.diagnostics new file mode 100644 index 0000000..39d6a70 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Arithmetic_SubtractionInteger.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", cast(\"PULocationID\" as DOUBLE) - CAST(90 as DOUBLE) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(193 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"fare_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/BooleanToInt.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/BooleanToInt.adbc.diagnostics new file mode 100644 index 0000000..2a90c4e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/BooleanToInt.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\", cast(\"store_and_fwd_flag\" as BIGINT) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Cast.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Cast.adbc.diagnostics new file mode 100644 index 0000000..1952123 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Cast.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"PULocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(75 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CharacterFromNumber.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CharacterFromNumber.adbc.diagnostics new file mode 100644 index 0000000..7ab0382 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CharacterFromNumber.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\", CHR(\"LocationID\") as \"C1\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CharacterToNumber.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CharacterToNumber.adbc.diagnostics new file mode 100644 index 0000000..07fd40e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CharacterToNumber.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\", ASCII(\"Borough\") as \"C1\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ConcatOverflow.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ConcatOverflow.adbc.diagnostics new file mode 100644 index 0000000..45a841f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ConcatOverflow.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", \"service_zone\", concat(\"Zone\", \"service_zone\") as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Count.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Count.adbc.diagnostics new file mode 100644 index 0000000..b170319 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Count.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_datetime\", COUNT(1) as \"C1\" from \"main\".\"NycTaxiData\" group by \"lpep_pickup_datetime\" order by \"lpep_pickup_datetime\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CreateNavigationPropertiesOption.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CreateNavigationPropertiesOption.adbc.diagnostics new file mode 100644 index 0000000..d80dc56 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/CreateNavigationPropertiesOption.adbc.diagnostics @@ -0,0 +1,17 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateAddDuration.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateAddDuration.adbc.diagnostics new file mode 100644 index 0000000..7d5808c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateAddDuration.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(cast(date_add(\"lpep_pickup_date\", cast(864000000000 / CAST(864000000000 as BIGINT) as BIGINT) * interval 1 Day) as TIMESTAMP) as DATE) as \"C1\", cast(cast(date_add(\"lpep_pickup_date\", cast(36000000000 / CAST(864000000000 as BIGINT) as BIGINT) * interval 1 Day) as TIMESTAMP) as DATE) as \"C2\", cast(cast(date_add(\"lpep_pickup_date\", cast(600000000 / CAST(864000000000 as BIGINT) as BIGINT) * interval 1 Day) as TIMESTAMP) as DATE) as \"C3\", cast(cast(date_add(\"lpep_pickup_date\", cast(10000000 / CAST(864000000000 as BIGINT) as BIGINT) * interval 1 Day) as TIMESTAMP) as DATE) as \"C4\", cast(cast(date_add(\"lpep_pickup_date\", cast(900612500000 / CAST(864000000000 as BIGINT) as BIGINT) * interval 1 Day) as TIMESTAMP) as DATE) as \"C5\", cast(cast(date_add(\"lpep_pickup_date\", cast((CAST(0 as BIGINT) - 900612500000) / CAST(864000000000 as BIGINT) as BIGINT) * interval 1 Day) as TIMESTAMP) as DATE) as \"C6\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" desc LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFilter_QueryFolding.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFilter_QueryFolding.adbc.diagnostics new file mode 100644 index 0000000..87d8c2a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFilter_QueryFolding.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\" where cast(\"RecordID\" as DOUBLE) = CAST(47531 as DOUBLE) and \"lpep_pickup_date\" = DATE '2023-02-23' order by \"RecordID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Day.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Day.adbc.diagnostics new file mode 100644 index 0000000..8651604 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Day.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", dayofmonth(\"lpep_pickup_date\") as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_DayOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_DayOfYear.adbc.diagnostics new file mode 100644 index 0000000..67e55fb --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_DayOfYear.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", dayofyear(\"lpep_pickup_date\") as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfDay.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfDay.adbc.diagnostics new file mode 100644 index 0000000..0407d9f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfDay.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 day) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 day) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfMonth.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfMonth.adbc.diagnostics new file mode 100644 index 0000000..f4e50bd --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfMonth.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 month) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 month) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfQuarter.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfQuarter.adbc.diagnostics new file mode 100644 index 0000000..2c1f26c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfQuarter.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 quarter) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 quarter) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfYear.adbc.diagnostics new file mode 100644 index 0000000..56e541b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_EndOfYear.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 year) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") + 1 as BIGINT) * interval 1 year) - interval 1 day as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Month.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Month.adbc.diagnostics new file mode 100644 index 0000000..57e647a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Month.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", month(\"lpep_pickup_date\") as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_QuarterOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_QuarterOfYear.adbc.diagnostics new file mode 100644 index 0000000..08ba1eb --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_QuarterOfYear.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", quarter(\"lpep_pickup_date\") as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfDay.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfDay.adbc.diagnostics new file mode 100644 index 0000000..f3d927c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfDay.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 day) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 day) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfMonth.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfMonth.adbc.diagnostics new file mode 100644 index 0000000..b947290 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfMonth.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 month) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 month) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfQuarter.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfQuarter.adbc.diagnostics new file mode 100644 index 0000000..58bb51d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfQuarter.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 quarter) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 quarter) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfYear.adbc.diagnostics new file mode 100644 index 0000000..e8ea479 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_StartOfYear.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 year) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", cast(date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_date\") as BIGINT) * interval 1 year) as DATE) as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_WeekOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_WeekOfYear.adbc.diagnostics new file mode 100644 index 0000000..3a0a352 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_WeekOfYear.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", week(\"lpep_pickup_date\") as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Year.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Year.adbc.diagnostics new file mode 100644 index 0000000..3d71f87 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Date_Year.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", year(\"lpep_pickup_date\") as \"C1\" from \"main\".\"NycTaxiDateData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_4.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_4.adbc.diagnostics new file mode 100644 index 0000000..067c571 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_4.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_datetime\" from \"main\".\"NycTaxiData\" where \"lpep_pickup_datetime\" = TIMESTAMP '2023-02-26 18:57:00.000000' and not \"lpep_pickup_datetime\" is null" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddDays.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddDays.adbc.diagnostics new file mode 100644 index 0000000..24bb202 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddDays.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(\"lpep_dropoff_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 day) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddMonths.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddMonths.adbc.diagnostics new file mode 100644 index 0000000..bdfa852 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddMonths.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(\"lpep_dropoff_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 month) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddQuarters.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddQuarters.adbc.diagnostics new file mode 100644 index 0000000..ef35181 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddQuarters.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(\"lpep_dropoff_datetime\", cast(CAST(1 as INTEGER) * 3 as BIGINT) * interval 1 month) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddWeeks.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddWeeks.adbc.diagnostics new file mode 100644 index 0000000..916369a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddWeeks.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(\"lpep_dropoff_datetime\", cast(CAST(1 as INTEGER) * 7 as BIGINT) * interval 1 day) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddYears.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddYears.adbc.diagnostics new file mode 100644 index 0000000..e93dbb5 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_AddYears.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(\"lpep_dropoff_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 year) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Day.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Day.adbc.diagnostics new file mode 100644 index 0000000..5c0126c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Day.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", dayofmonth(\"lpep_dropoff_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_DayOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_DayOfYear.adbc.diagnostics new file mode 100644 index 0000000..4608b70 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_DayOfYear.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", dayofyear(\"lpep_dropoff_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfDay.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfDay.adbc.diagnostics new file mode 100644 index 0000000..dbc9fc6 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfDay.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 day) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 day) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfMonth.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfMonth.adbc.diagnostics new file mode 100644 index 0000000..d7f13fe --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfMonth.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 month) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 month) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfQuarter.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfQuarter.adbc.diagnostics new file mode 100644 index 0000000..fec1b84 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfQuarter.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 quarter) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 quarter) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfYear.adbc.diagnostics new file mode 100644 index 0000000..88194ca --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_EndOfYear.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 year) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") + 1 as BIGINT) * interval 1 year) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Month.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Month.adbc.diagnostics new file mode 100644 index 0000000..0df628f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Month.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", month(\"lpep_dropoff_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_QuarterOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_QuarterOfYear.adbc.diagnostics new file mode 100644 index 0000000..52d6485 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_QuarterOfYear.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", quarter(\"lpep_dropoff_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfDay.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfDay.adbc.diagnostics new file mode 100644 index 0000000..72a6eb2 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfDay.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 day) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(day, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 day) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfMonth.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfMonth.adbc.diagnostics new file mode 100644 index 0000000..9467467 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfMonth.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 month) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(month, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 month) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfQuarter.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfQuarter.adbc.diagnostics new file mode 100644 index 0000000..8523720 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfQuarter.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 quarter) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(quarter, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 quarter) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfYear.adbc.diagnostics new file mode 100644 index 0000000..e3b85ff --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_StartOfYear.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 year) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(year, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_dropoff_datetime\") as BIGINT) * interval 1 year) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_WeekOfYear.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_WeekOfYear.adbc.diagnostics new file mode 100644 index 0000000..d846600 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_WeekOfYear.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", week(\"lpep_dropoff_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Year.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Year.adbc.diagnostics new file mode 100644 index 0000000..25f050d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateFunctions_over_Datetime_Year.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_dropoff_datetime\", year(\"lpep_dropoff_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateTimeAddDuration.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateTimeAddDuration.adbc.diagnostics new file mode 100644 index 0000000..fc6d371 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateTimeAddDuration.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Day) as TIMESTAMP) as \"C1\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Hour) as TIMESTAMP) as \"C2\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Minute) as TIMESTAMP) as \"C3\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Second) as TIMESTAMP) as \"C4\", cast(date_add(cast(date_add(cast(date_add(cast(date_add(cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Day) as TIMESTAMP), cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Hour) as TIMESTAMP), cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Minute) as TIMESTAMP), cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Second) as TIMESTAMP), cast(CAST(250000 as INTEGER) as BIGINT) * interval 1 Nanosecond) as TIMESTAMP) as \"C5\", cast(date_add(cast(date_add(cast(date_add(cast(date_add(cast(date_add(\"lpep_pickup_datetime\", cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Day) as TIMESTAMP), cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Hour) as TIMESTAMP), cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Minute) as TIMESTAMP), cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Second) as TIMESTAMP), cast(CAST(-250000 as INTEGER) as BIGINT) * interval 1 Nanosecond) as TIMESTAMP) as \"C6\" from \"main\".\"NycTaxiData\" order by \"RecordID\" desc LIMIT 5" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Day) as TIMESTAMP) as \"C1\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Hour) as TIMESTAMP) as \"C2\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Minute) as TIMESTAMP) as \"C3\", cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Second) as TIMESTAMP) as \"C4\", cast(date_add(cast(date_add(cast(date_add(cast(date_add(cast(date_add(\"lpep_pickup_datetime\", cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Day) as TIMESTAMP), cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Hour) as TIMESTAMP), cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Minute) as TIMESTAMP), cast(CAST(1 as INTEGER) as BIGINT) * interval 1 Second) as TIMESTAMP), cast(CAST(250000 as INTEGER) as BIGINT) * interval 1 Nanosecond) as TIMESTAMP) as \"C5\", cast(date_add(cast(date_add(cast(date_add(cast(date_add(cast(date_add(\"lpep_pickup_datetime\", cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Day) as TIMESTAMP), cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Hour) as TIMESTAMP), cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Minute) as TIMESTAMP), cast(CAST(-1 as INTEGER) as BIGINT) * interval 1 Second) as TIMESTAMP), cast(CAST(-250000 as INTEGER) as BIGINT) * interval 1 Nanosecond) as TIMESTAMP) as \"C6\" from \"main\".\"NycTaxiData\" order by \"RecordID\" desc LIMIT 5" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateTimeArithmetic.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateTimeArithmetic.adbc.diagnostics new file mode 100644 index 0000000..302b383 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DateTimeArithmetic.adbc.diagnostics @@ -0,0 +1,32 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", \"lpep_pickup_datetime\", cast(timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '1999-01-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C1\", cast(timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-02-06 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C2\", cast(timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-09-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C3\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"PULocationID\", \"ITBL\".\"RecordID\" LIMIT 4" + }, + { + "Command": "select \"PULocationID\", \"lpep_pickup_datetime\", cast(timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '1999-01-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C1\", cast(timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-02-06 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C2\", cast(timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-09-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C3\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"PULocationID\", \"ITBL\".\"RecordID\" LIMIT 4" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + }, + { + "Command": "select \"PULocationID\", \"lpep_pickup_datetime\", cast(timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '1999-01-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C1\", cast(timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-02-06 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C2\", cast(timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-09-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C3\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"PULocationID\", \"ITBL\".\"RecordID\" LIMIT 4" + }, + { + "Command": "select \"PULocationID\", \"lpep_pickup_datetime\", cast(timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '1999-01-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '1999-01-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C1\", cast(timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-02-06 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-02-06 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C2\", cast(timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\") as BIGINT) * CAST(864000000000 as BIGINT) + cast(timestampdiff(nanosecond, timestampadd(day, timestampdiff(day, TIMESTAMP '2007-09-05 00:00:00.000000', \"lpep_pickup_datetime\"), TIMESTAMP '2007-09-05 00:00:00.000000'), \"lpep_pickup_datetime\") as BIGINT) * CAST(10 as BIGINT) as \"C3\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"PULocationID\", \"ITBL\".\"RecordID\" LIMIT 4" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DecimalFrom.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DecimalFrom.adbc.diagnostics new file mode 100644 index 0000000..5ea4314 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DecimalFrom.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"total_amount\", cast(\"total_amount\" as DECIMAL(38,6)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DoubleFrom.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DoubleFrom.adbc.diagnostics new file mode 100644 index 0000000..cd478c1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/DoubleFrom.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"total_amount\", cast(\"total_amount\" as DOUBLE) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ExtendedTypes.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ExtendedTypes.adbc.diagnostics new file mode 100644 index 0000000..0124f5d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ExtendedTypes.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'ExtendedTypes' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'ExtendedTypes' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"HugeIntCol\", \"UuidCol\", \"JsonCol\", \"BlobCol\" from \"main\".\"ExtendedTypes\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstEntry.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstEntry.adbc.diagnostics new file mode 100644 index 0000000..ef26d2a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstEntry.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNGroup.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNGroup.adbc.diagnostics new file mode 100644 index 0000000..4495098 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNGroup.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"service_zone\" from \"main\".\"TaxiZoneLookup\" group by \"service_zone\" order by \"service_zone\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNGroupSort.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNGroupSort.adbc.diagnostics new file mode 100644 index 0000000..721c999 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNGroupSort.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"service_zone\" from ( select \"service_zone\" from \"main\".\"TaxiZoneLookup\" group by \"service_zone\" LIMIT 5 ) as \"ITBL\" order by \"service_zone\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNSort.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNSort.adbc.diagnostics new file mode 100644 index 0000000..85ff056 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNSort.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"service_zone\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNSortGroup.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNSortGroup.adbc.diagnostics new file mode 100644 index 0000000..1f7f77d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FirstNSortGroup.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"service_zone\" LIMIT 3" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListAverage.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListAverage.adbc.diagnostics new file mode 100644 index 0000000..61c8980 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListAverage.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select round(AVG(cast(\"trip_distance\" as DOUBLE)), CAST(8 as INTEGER)) as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCount.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCount.adbc.diagnostics new file mode 100644 index 0000000..02dd432 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCount.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select COUNT(1) as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountDistinct.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountDistinct.adbc.diagnostics new file mode 100644 index 0000000..1b7eb0c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountDistinct.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", COUNT(1) as \"C1\" from \"main\".\"NycTaxiData\" group by \"PULocationID\" order by \"PULocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountDistinctSelect.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountDistinctSelect.adbc.diagnostics new file mode 100644 index 0000000..1b7eb0c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountDistinctSelect.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", COUNT(1) as \"C1\" from \"main\".\"NycTaxiData\" group by \"PULocationID\" order by \"PULocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountSelect.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountSelect.adbc.diagnostics new file mode 100644 index 0000000..1b7eb0c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListCountSelect.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", COUNT(1) as \"C1\" from \"main\".\"NycTaxiData\" group by \"PULocationID\" order by \"PULocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListFirst.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListFirst.adbc.diagnostics new file mode 100644 index 0000000..81db1ad --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListFirst.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListFirstNGroup.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListFirstNGroup.adbc.diagnostics new file mode 100644 index 0000000..2c8bd56 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListFirstNGroup.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"lpep_pickup_datetime\" LIMIT 10" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListMax.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListMax.adbc.diagnostics new file mode 100644 index 0000000..440a71e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListMax.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select MAX(\"trip_distance\") as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListMin.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListMin.adbc.diagnostics new file mode 100644 index 0000000..54fa9ef --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListMin.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select MIN(\"trip_distance\") as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListNotNullCount.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListNotNullCount.adbc.diagnostics new file mode 100644 index 0000000..81db1ad --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListNotNullCount.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListStandardDeviation.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListStandardDeviation.adbc.diagnostics new file mode 100644 index 0000000..81db1ad --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListStandardDeviation.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListSum.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListSum.adbc.diagnostics new file mode 100644 index 0000000..b14914c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldListSum.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select round(SUM(cast(\"trip_distance\" as DOUBLE)), CAST(8 as INTEGER)) as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldTableRowCount.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldTableRowCount.adbc.diagnostics new file mode 100644 index 0000000..02dd432 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldTableRowCount.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select COUNT(1) as \"C1\" from \"main\".\"NycTaxiData\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldsDateTimeComparison.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldsDateTimeComparison.adbc.diagnostics new file mode 100644 index 0000000..5906099 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldsDateTimeComparison.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_datetime\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" where \"lpep_pickup_datetime\" <= TIMESTAMP '2023-02-03 01:00:00.000000' order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldsTextFromDateTime.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldsTextFromDateTime.adbc.diagnostics new file mode 100644 index 0000000..0724e90 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/FoldsTextFromDateTime.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListAverage.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListAverage.adbc.diagnostics new file mode 100644 index 0000000..5108061 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListAverage.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Borough\", round(\"C1\", CAST(6 as INTEGER)) as \"C2\" from ( select \"Borough\", AVG(cast(\"LocationID\" as DECIMAL)) as \"C1\" from \"main\".\"TaxiZoneLookup\" group by \"Borough\" ) as \"ITBL\" order by \"Borough\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListMinMax.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListMinMax.adbc.diagnostics new file mode 100644 index 0000000..ff588c1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListMinMax.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Borough\", MAX(\"Zone\") as \"C1\", MIN(\"Zone\") as \"C2\", MAX(\"LocationID\") as \"C3\", MIN(\"LocationID\") as \"C4\" from \"main\".\"TaxiZoneLookup\" group by \"Borough\" order by \"Borough\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListMinMaxDateTime.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListMinMaxDateTime.adbc.diagnostics new file mode 100644 index 0000000..a141630 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithListMinMaxDateTime.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", MAX(\"lpep_pickup_datetime\") as \"C1\", MIN(\"lpep_pickup_datetime\") as \"C2\" from \"main\".\"NycTaxiData\" group by \"PULocationID\" order by \"PULocationID\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithTableRunCount.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithTableRunCount.adbc.diagnostics new file mode 100644 index 0000000..64d8903 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/GroupByWithTableRunCount.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", COUNT(1) as \"C1\" from \"main\".\"TaxiZoneLookup\" group by \"Zone\" order by \"Zone\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/IfBoolean.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/IfBoolean.adbc.diagnostics new file mode 100644 index 0000000..6584494 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/IfBoolean.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select case when \"store_and_fwd_flag\" = true and not \"store_and_fwd_flag\" is null then true else false end as \"C1\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" where \"C1\" = false order by \"C1\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int16From.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int16From.adbc.diagnostics new file mode 100644 index 0000000..882eeb7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int16From.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32From.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32From.adbc.diagnostics new file mode 100644 index 0000000..cc6cec0 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32From.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"RecordID\", \"RecordID\" as \"C1\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromDate.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromDate.adbc.diagnostics new file mode 100644 index 0000000..2dbb0a7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromDate.adbc.diagnostics @@ -0,0 +1,23 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_date\", cast(\"lpep_pickup_date\" as INTEGER) as \"C1\" from ( select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromDateTime.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromDateTime.adbc.diagnostics new file mode 100644 index 0000000..fcaf5c1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromDateTime.adbc.diagnostics @@ -0,0 +1,23 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'misc_table' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'misc_table' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"DATETIMEFIELD\", cast(\"DATETIMEFIELD\" as INTEGER) as \"C1\" from ( select \"DATETIMEFIELD\", \"BOOLEANFIELD\", \"BIGNUMERICFIELD\", \"NUMERICFIELD\", \"INTEGERFIELD\", \"STRINGFIELD\" from \"main\".\"misc_table\" ) as \"ITBL\" order by \"ITBL\".\"INTEGERFIELD\" desc LIMIT 1" + }, + { + "Command": "select \"DATETIMEFIELD\", \"BOOLEANFIELD\", \"BIGNUMERICFIELD\", \"NUMERICFIELD\", \"INTEGERFIELD\", \"STRINGFIELD\" from \"main\".\"misc_table\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromLogical.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromLogical.adbc.diagnostics new file mode 100644 index 0000000..eccf53d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromLogical.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'misc_table' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'misc_table' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"BOOLEANFIELD\", cast(\"BOOLEANFIELD\" as INTEGER) as \"C1\" from ( select \"DATETIMEFIELD\", \"BOOLEANFIELD\", \"BIGNUMERICFIELD\", \"NUMERICFIELD\", \"INTEGERFIELD\", \"STRINGFIELD\" from \"main\".\"misc_table\" ) as \"ITBL\" order by \"ITBL\".\"INTEGERFIELD\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumber.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumber.adbc.diagnostics new file mode 100644 index 0000000..2364c1a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumber.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(\"trip_distance\" as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberRoundDown.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberRoundDown.adbc.diagnostics new file mode 100644 index 0000000..2f8445f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberRoundDown.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(FLOOR(\"trip_distance\") as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberRoundUp.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberRoundUp.adbc.diagnostics new file mode 100644 index 0000000..b7c1f98 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberRoundUp.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(CEIL(\"trip_distance\") as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberTowardsZero.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberTowardsZero.adbc.diagnostics new file mode 100644 index 0000000..2364c1a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromNumberTowardsZero.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(\"trip_distance\" as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromText.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromText.adbc.diagnostics new file mode 100644 index 0000000..2ae378c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromText.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(cast(\"trip_distance\" as VARCHAR) as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextRoundDown.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextRoundDown.adbc.diagnostics new file mode 100644 index 0000000..87d6490 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextRoundDown.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(FLOOR(cast(cast(\"trip_distance\" as VARCHAR) as DOUBLE)) as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextRoundUp.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextRoundUp.adbc.diagnostics new file mode 100644 index 0000000..111c96b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextRoundUp.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(CEIL(cast(cast(\"trip_distance\" as VARCHAR) as DOUBLE)) as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextTowardZero.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextTowardZero.adbc.diagnostics new file mode 100644 index 0000000..2920900 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int32FromTextTowardZero.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(cast(cast(\"trip_distance\" as VARCHAR) as DOUBLE) as INTEGER) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64From.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64From.adbc.diagnostics new file mode 100644 index 0000000..fe0f34f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64From.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"RecordID\", cast(\"RecordID\" as BIGINT) as \"C1\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromDate.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromDate.adbc.diagnostics new file mode 100644 index 0000000..7e47ea2 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromDate.adbc.diagnostics @@ -0,0 +1,23 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiDateData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiDateData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_date\", cast(\"lpep_pickup_date\" as BIGINT) as \"C1\" from ( select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_date\", \"lpep_dropoff_date\" from \"main\".\"NycTaxiDateData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromDateTime.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromDateTime.adbc.diagnostics new file mode 100644 index 0000000..8b7edc7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromDateTime.adbc.diagnostics @@ -0,0 +1,23 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'misc_table' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'misc_table' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"DATETIMEFIELD\", cast(\"DATETIMEFIELD\" as BIGINT) as \"C1\" from ( select \"DATETIMEFIELD\", \"BOOLEANFIELD\", \"BIGNUMERICFIELD\", \"NUMERICFIELD\", \"INTEGERFIELD\", \"STRINGFIELD\" from \"main\".\"misc_table\" ) as \"ITBL\" order by \"ITBL\".\"INTEGERFIELD\" desc LIMIT 1" + }, + { + "Command": "select \"DATETIMEFIELD\", \"BOOLEANFIELD\", \"BIGNUMERICFIELD\", \"NUMERICFIELD\", \"INTEGERFIELD\", \"STRINGFIELD\" from \"main\".\"misc_table\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromLogical.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromLogical.adbc.diagnostics new file mode 100644 index 0000000..087fe36 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromLogical.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'misc_table' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'misc_table' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"BOOLEANFIELD\", cast(\"BOOLEANFIELD\" as BIGINT) as \"C1\" from ( select \"DATETIMEFIELD\", \"BOOLEANFIELD\", \"BIGNUMERICFIELD\", \"NUMERICFIELD\", \"INTEGERFIELD\", \"STRINGFIELD\" from \"main\".\"misc_table\" ) as \"ITBL\" order by \"ITBL\".\"INTEGERFIELD\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumber.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumber.adbc.diagnostics new file mode 100644 index 0000000..ff69066 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumber.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(\"trip_distance\" as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberRoundDown.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberRoundDown.adbc.diagnostics new file mode 100644 index 0000000..9fa3838 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberRoundDown.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(FLOOR(\"trip_distance\") as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberRoundUp.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberRoundUp.adbc.diagnostics new file mode 100644 index 0000000..3fd0eef --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberRoundUp.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(CEIL(\"trip_distance\") as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberTowardsZero.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberTowardsZero.adbc.diagnostics new file mode 100644 index 0000000..ff69066 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromNumberTowardsZero.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(\"trip_distance\" as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromText.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromText.adbc.diagnostics new file mode 100644 index 0000000..0154d34 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromText.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(cast(\"trip_distance\" as VARCHAR) as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextRoundDown.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextRoundDown.adbc.diagnostics new file mode 100644 index 0000000..5467b65 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextRoundDown.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(FLOOR(cast(cast(\"trip_distance\" as VARCHAR) as DOUBLE)) as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextRoundUp.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextRoundUp.adbc.diagnostics new file mode 100644 index 0000000..1d41d10 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextRoundUp.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(CEIL(cast(cast(\"trip_distance\" as VARCHAR) as DOUBLE)) as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextTowardsZero.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextTowardsZero.adbc.diagnostics new file mode 100644 index 0000000..c2e0568 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int64FromTextTowardsZero.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", cast(cast(cast(\"trip_distance\" as VARCHAR) as DOUBLE) as BIGINT) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int8From.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int8From.adbc.diagnostics new file mode 100644 index 0000000..882eeb7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Int8From.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsMultipleElementWithNull.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsMultipleElementWithNull.adbc.diagnostics new file mode 100644 index 0000000..dcf5e95 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsMultipleElementWithNull.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where \"PULocationID\" in (CAST(1 as INTEGER), CAST(2 as INTEGER), null)" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsMultipleElements.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsMultipleElements.adbc.diagnostics new file mode 100644 index 0000000..4aee592 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsMultipleElements.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where \"PULocationID\" in (CAST(1 as INTEGER), CAST(2 as INTEGER), CAST(3 as INTEGER))" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsNullAsSingleElement.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsNullAsSingleElement.adbc.diagnostics new file mode 100644 index 0000000..ec96304 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsNullAsSingleElement.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where \"PULocationID\" is null" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsNullandZero.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsNullandZero.adbc.diagnostics new file mode 100644 index 0000000..16c0dcf --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsNullandZero.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where \"PULocationID\" in (null, CAST(0 as INTEGER))" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsSingleElement.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsSingleElement.adbc.diagnostics new file mode 100644 index 0000000..23729c1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ListContainsSingleElement.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where \"PULocationID\" = CAST(1 as INTEGER)" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/LogicalFrom.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/LogicalFrom.adbc.diagnostics new file mode 100644 index 0000000..841d19f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/LogicalFrom.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"store_and_fwd_flag\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/MultiplyColumnsOfDifferenttypes.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/MultiplyColumnsOfDifferenttypes.adbc.diagnostics new file mode 100644 index 0000000..7291c3e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/MultiplyColumnsOfDifferenttypes.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_pickup_datetime\", round(cast(\"payment_type\" as DOUBLE) * cast(\"fare_amount\" as DOUBLE), CAST(2 as INTEGER)) as \"C1\" from \"main\".\"NycTaxiData\" order by \"lpep_pickup_datetime\" LIMIT 2" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NavigationMetadata.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NavigationMetadata.adbc.diagnostics new file mode 100644 index 0000000..d80dc56 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NavigationMetadata.adbc.diagnostics @@ -0,0 +1,17 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NestedTypes.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NestedTypes.adbc.diagnostics new file mode 100644 index 0000000..cd1a177 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NestedTypes.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NestedTypes' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NestedTypes' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"ArrayCol\", \"StructCol\" from \"main\".\"NestedTypes\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NullableEquals.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NullableEquals.adbc.diagnostics new file mode 100644 index 0000000..8de67f2 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NullableEquals.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"total_amount\", \"payment_type\", cast(\"payment_type\" as DOUBLE) = CAST(4 as DOUBLE) as \"C1\" from \"main\".\"NycTaxiData\" order by \"total_amount\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions.adbc.diagnostics new file mode 100644 index 0000000..7c85353 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", \"fare_amount\", ABS(\"fare_amount\") as \"C1\", ACOS(cast(\"fare_amount\" as DOUBLE) / cast(\"fare_amount\" as DOUBLE)) as \"C2\", ASIN(cast(\"fare_amount\" as DOUBLE) / cast(\"fare_amount\" as DOUBLE)) as \"C3\", ATAN(cast(\"fare_amount\" as DOUBLE)) as \"C4\", ceil(\"fare_amount\") as \"C5\", COS(cast(\"fare_amount\" as DOUBLE)) as \"C6\", EXP(cast(\"fare_amount\" as DOUBLE)) as \"C7\", floor(\"fare_amount\") as \"C8\", LN(cast(\"PULocationID\" as DOUBLE)) as \"C9\", round(log10(cast(\"PULocationID\" as DOUBLE)), CAST(12 as INTEGER)) as \"C10\", POWER(cast(\"fare_amount\" as DOUBLE) / cast(\"fare_amount\" as DOUBLE), CAST(3 as INTEGER)) as \"C11\", round(\"fare_amount\") as \"C12\", round(\"fare_amount\", CAST(1 as INTEGER)) as \"C13\", SIGN(\"fare_amount\") as \"C14\", SQRT(cast(\"fare_amount\" as DOUBLE)) as \"C15\", TAN(cast(\"fare_amount\" as DOUBLE)) as \"C16\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Abs.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Abs.adbc.diagnostics new file mode 100644 index 0000000..202b00b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Abs.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", ABS(\"fare_amount\") as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Acos.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Acos.adbc.diagnostics new file mode 100644 index 0000000..0dd9a99 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Acos.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", ACOS(cast(\"fare_amount\" as DOUBLE) / cast(\"fare_amount\" as DOUBLE)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Asin.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Asin.adbc.diagnostics new file mode 100644 index 0000000..079fabf --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Asin.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(ASIN(cast(\"fare_amount\" as DOUBLE) / cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", floor(ASIN(cast(\"fare_amount\" as DOUBLE) / cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Atan.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Atan.adbc.diagnostics new file mode 100644 index 0000000..8ed9af6 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Atan.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(ATAN(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", floor(ATAN(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Atan2.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Atan2.adbc.diagnostics new file mode 100644 index 0000000..35213b6 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Atan2.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(ATAN2(cast(\"fare_amount\" as DOUBLE), CAST(1 as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", floor(ATAN2(cast(\"fare_amount\" as DOUBLE), CAST(1 as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Ceiling.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Ceiling.adbc.diagnostics new file mode 100644 index 0000000..380ff12 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Ceiling.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", ceil(\"fare_amount\") as \"C1\", ceil(\"fare_amount\", CAST(2 as INTEGER)) as \"C2\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", ceil(\"fare_amount\") as \"C1\", ceil(\"fare_amount\", CAST(2 as INTEGER)) as \"C2\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Cos.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Cos.adbc.diagnostics new file mode 100644 index 0000000..502c1fd --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Cos.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(COS(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", floor(COS(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Exp.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Exp.adbc.diagnostics new file mode 100644 index 0000000..d55cfc7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Exp.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", EXP(cast(\"fare_amount\" as DOUBLE)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Floor.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Floor.adbc.diagnostics new file mode 100644 index 0000000..7036935 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Floor.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(\"fare_amount\") as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Log.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Log.adbc.diagnostics new file mode 100644 index 0000000..324d850 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Log.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", floor(LN(cast(\"PULocationID\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"PULocationID\", floor(LN(cast(\"PULocationID\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Log10.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Log10.adbc.diagnostics new file mode 100644 index 0000000..717b5e1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Log10.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"PULocationID\", round(log10(cast(\"PULocationID\" as DOUBLE)), CAST(12 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Mod.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Mod.adbc.diagnostics new file mode 100644 index 0000000..9e45c97 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Mod.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Power.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Power.adbc.diagnostics new file mode 100644 index 0000000..6200e7e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Power.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", POWER(cast(\"fare_amount\" as DOUBLE) / cast(\"fare_amount\" as DOUBLE), CAST(3 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Round.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Round.adbc.diagnostics new file mode 100644 index 0000000..89c6e49 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Round.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", round(\"fare_amount\") as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_RoundDigits.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_RoundDigits.adbc.diagnostics new file mode 100644 index 0000000..dd2a01f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_RoundDigits.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", round(\"fare_amount\", CAST(1 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sign.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sign.adbc.diagnostics new file mode 100644 index 0000000..dc0bc9b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sign.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", SIGN(\"fare_amount\") as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sin.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sin.adbc.diagnostics new file mode 100644 index 0000000..89ff241 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sin.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(SIN(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", floor(SIN(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sqrt.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sqrt.adbc.diagnostics new file mode 100644 index 0000000..007830f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Sqrt.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(SQRT(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", floor(SQRT(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Tan.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Tan.adbc.diagnostics new file mode 100644 index 0000000..05f7106 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/NumberFunctions_Tan.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"fare_amount\", floor(TAN(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"fare_amount\", floor(TAN(cast(\"fare_amount\" as DOUBLE)), CAST(5 as INTEGER)) as \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" where cast(\"PULocationID\" as DOUBLE) = CAST(170 as DOUBLE) and not \"PULocationID\" is null ) as \"ITBL\" order by \"ITBL\".\"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SelectRowsBoolColumn.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SelectRowsBoolColumn.adbc.diagnostics new file mode 100644 index 0000000..472486c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SelectRowsBoolColumn.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_dropoff_datetime\", \"DOLocationID\" from \"main\".\"NycTaxiData\" where \"store_and_fwd_flag\" = true and not \"store_and_fwd_flag\" is null order by \"DOLocationID\" LIMIT 2" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SelectRowsStringColumn.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SelectRowsStringColumn.adbc.diagnostics new file mode 100644 index 0000000..7e53f0f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SelectRowsStringColumn.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Borough\", \"LocationID\" from \"main\".\"TaxiZoneLookup\" where \"Borough\" = CAST('Queens' as VARCHAR) and not \"Borough\" is null order by \"LocationID\" LIMIT 2" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SkipTake.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SkipTake.adbc.diagnostics new file mode 100644 index 0000000..85b2c64 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SkipTake.adbc.diagnostics @@ -0,0 +1,29 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\" LIMIT 1" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\" OFFSET 264" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\" LIMIT 1 OFFSET 200" + }, + { + "Command": "select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" order by \"LocationID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Sort.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Sort.adbc.diagnostics new file mode 100644 index 0000000..a827cc2 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Sort.adbc.diagnostics @@ -0,0 +1,29 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"VendorID\"" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"lpep_pickup_datetime\"" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"store_and_fwd_flag\"" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\" order by \"trip_distance\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SortDatetime.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SortDatetime.adbc.diagnostics new file mode 100644 index 0000000..9f510bf --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SortDatetime.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_dropoff_datetime\" from ( select \"lpep_dropoff_datetime\", case when not \"lpep_dropoff_datetime\" is null then \"lpep_dropoff_datetime\" else TIMESTAMP '1899-12-28 00:00:00.000000' end as \"C1\", case when \"lpep_dropoff_datetime\" is null then CAST(0 as INTEGER) else CAST(1 as INTEGER) end as \"C2\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"C1\", \"ITBL\".\"C2\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SortTimestamp.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SortTimestamp.adbc.diagnostics new file mode 100644 index 0000000..9f510bf --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/SortTimestamp.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"lpep_dropoff_datetime\" from ( select \"lpep_dropoff_datetime\", case when not \"lpep_dropoff_datetime\" is null then \"lpep_dropoff_datetime\" else TIMESTAMP '1899-12-28 00:00:00.000000' end as \"C1\", case when \"lpep_dropoff_datetime\" is null then CAST(0 as INTEGER) else CAST(1 as INTEGER) end as \"C2\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"C1\", \"ITBL\".\"C2\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/StringLiteral.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/StringLiteral.adbc.diagnostics new file mode 100644 index 0000000..ff484f7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/StringLiteral.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" where \"Zone\" = CAST('Westchester Village/Unionport' as VARCHAR) and not \"Zone\" is null ) as \"ITBL\" order by \"ITBL\".\"LocationID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Sum.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Sum.adbc.diagnostics new file mode 100644 index 0000000..45b5b56 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/Sum.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select round(SUM(cast(\"total_amount\" as DOUBLE)), CAST(2 as INTEGER)) as \"C1\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_1.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_1.adbc.diagnostics new file mode 100644 index 0000000..29c1946 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_1.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", \"fare_amount\", \"payment_type\" from ( select \"OTBL\".\"trip_distance\", \"OTBL\".\"fare_amount\", \"OTBL\".\"payment_type\" from \"main\".\"NycTaxiData\" as \"OTBL\" left outer join \"main\".\"TaxiZoneLookup\" as \"ITBL\" on (cast(\"OTBL\".\"PULocationID\" as DOUBLE) = cast(\"ITBL\".\"LocationID\" as DOUBLE) or \"OTBL\".\"PULocationID\" is null and \"ITBL\".\"LocationID\" is null) where (\"ITBL\".\"Borough\" = CAST('Bronx' as VARCHAR) and not \"ITBL\".\"Borough\" is null) and cast(cast(\"OTBL\".\"VendorID\" as BIGINT) as DOUBLE) = CAST(1 as DOUBLE) ) as \"ITBL\" group by \"trip_distance\", \"fare_amount\", \"payment_type\" order by \"trip_distance\", \"payment_type\", \"fare_amount\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_2.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_2.adbc.diagnostics new file mode 100644 index 0000000..897c004 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_2.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"payment_type\", COUNT(1) as \"C1\" from ( select \"OTBL\".\"VendorID\", \"OTBL\".\"payment_type\" from \"main\".\"NycTaxiData\" as \"OTBL\" left outer join \"main\".\"TaxiZoneLookup\" as \"ITBL\" on (cast(\"OTBL\".\"PULocationID\" as DOUBLE) = cast(\"ITBL\".\"LocationID\" as DOUBLE) or \"OTBL\".\"PULocationID\" is null and \"ITBL\".\"LocationID\" is null) where (\"ITBL\".\"Borough\" = CAST('Bronx' as VARCHAR) and not \"ITBL\".\"Borough\" is null) and cast(cast(\"OTBL\".\"VendorID\" as BIGINT) as DOUBLE) = CAST(1 as DOUBLE) ) as \"ITBL\" group by \"payment_type\" order by \"payment_type\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_3.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_3.adbc.diagnostics new file mode 100644 index 0000000..1b5ad37 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_3.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"trip_distance\", \"fare_amount\", \"payment_type\" from ( select \"OTBL\".\"trip_distance\", \"OTBL\".\"fare_amount\", \"OTBL\".\"payment_type\" from \"main\".\"NycTaxiData\" as \"OTBL\" left outer join \"main\".\"TaxiZoneLookup\" as \"ITBL\" on (cast(\"OTBL\".\"PULocationID\" as DOUBLE) = cast(\"ITBL\".\"LocationID\" as DOUBLE) or \"OTBL\".\"PULocationID\" is null and \"ITBL\".\"LocationID\" is null) where (\"ITBL\".\"Borough\" = CAST('Bronx' as VARCHAR) or \"ITBL\".\"Borough\" is null) and (cast(\"OTBL\".\"VendorID\" as BIGINT) = CAST(1 as INTEGER) or \"OTBL\".\"VendorID\" is null) ) as \"ITBL\" group by \"trip_distance\", \"fare_amount\", \"payment_type\" order by \"trip_distance\", \"payment_type\", \"fare_amount\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_4.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_4.adbc.diagnostics new file mode 100644 index 0000000..3d1e7a1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TableJoin_4.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"OTBL\".\"LocationID\", \"OTBL\".\"LocationID\" as \"C1\" from \"main\".\"TaxiZoneLookup\" as \"OTBL\" left outer join \"main\".\"NycTaxiData\" as \"ITBL\" on (cast(\"OTBL\".\"LocationID\" as DOUBLE) = cast(\"ITBL\".\"PULocationID\" as DOUBLE) or \"OTBL\".\"LocationID\" is null and \"ITBL\".\"PULocationID\" is null) order by \"LocationID\" LIMIT 5" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFromDecimal.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFromDecimal.adbc.diagnostics new file mode 100644 index 0000000..1c2344c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFromDecimal.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\", cast(\"VendorID\" as VARCHAR) as \"C1\", cast(\"total_amount\" as VARCHAR) as \"C2\" from \"main\".\"NycTaxiData\" order by \"total_amount\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFromInt.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFromInt.adbc.diagnostics new file mode 100644 index 0000000..13b82ae --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFromInt.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\", cast(\"VendorID\" as VARCHAR) as \"C1\" from \"main\".\"NycTaxiData\" order by \"total_amount\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFunctions.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFunctions.adbc.diagnostics new file mode 100644 index 0000000..503e056 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextFunctions.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" where (CONTAINS(\"Zone\", CAST('ton' as VARCHAR)) = true and starts_with(\"Zone\", CAST('Was' as VARCHAR)) = true) and suffix(\"Zone\", CAST('th' as VARCHAR)) = true ) as \"ITBL\" order by \"ITBL\".\"LocationID\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextLengthOnStringColumn.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextLengthOnStringColumn.adbc.diagnostics new file mode 100644 index 0000000..e133e8f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextLengthOnStringColumn.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", LENGTH(\"Zone\") as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextLowerConvertToLower.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextLowerConvertToLower.adbc.diagnostics new file mode 100644 index 0000000..c46357a --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextLowerConvertToLower.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", LOWER(\"Zone\") as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithExcessiveLength.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithExcessiveLength.adbc.diagnostics new file mode 100644 index 0000000..a174d94 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithExcessiveLength.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", SUBSTRING(\"Zone\", CAST(2 as INTEGER) + 1, CAST(10 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithNegativeLength.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithNegativeLength.adbc.diagnostics new file mode 100644 index 0000000..561932f --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithNegativeLength.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", SUBSTRING(\"Zone\", CAST(3 as INTEGER) + 1, CAST(-1 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithNull.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithNull.adbc.diagnostics new file mode 100644 index 0000000..57cae4d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithNull.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", SUBSTRING(\"Zone\", CAST(2 as INTEGER) + 1, IFNULL(null, LENGTH(\"Zone\") - CAST(2 as INTEGER))) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithOneParameter.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithOneParameter.adbc.diagnostics new file mode 100644 index 0000000..f714d01 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithOneParameter.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", SUBSTRING(\"Zone\", CAST(2 as INTEGER) + 1, LENGTH(\"Zone\") - CAST(2 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithTwoParameter.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithTwoParameter.adbc.diagnostics new file mode 100644 index 0000000..e3e3641 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithTwoParameter.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", SUBSTRING(\"Zone\", CAST(2 as INTEGER) + 1, CAST(2 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithZeroLength.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithZeroLength.adbc.diagnostics new file mode 100644 index 0000000..d5fe9ce --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextMiddleWithZeroLength.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", SUBSTRING(\"Zone\", CAST(2 as INTEGER) + 1, CAST(0 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfEmptyString.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfEmptyString.adbc.diagnostics new file mode 100644 index 0000000..8397b85 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfEmptyString.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", INSTR(\"Zone\", CAST('' as VARCHAR)) - 1 as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringAtEnd.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringAtEnd.adbc.diagnostics new file mode 100644 index 0000000..85a836c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringAtEnd.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", INSTR(\"Zone\", CAST('Airport' as VARCHAR)) - 1 as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringAtStart.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringAtStart.adbc.diagnostics new file mode 100644 index 0000000..b2b9384 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringAtStart.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", INSTR(\"Zone\", CAST('Newark' as VARCHAR)) - 1 as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringPresent.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringPresent.adbc.diagnostics new file mode 100644 index 0000000..c3322ac --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextPositionOfSubstringPresent.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", INSTR(\"Zone\", CAST('k A' as VARCHAR)) - 1 as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatMultipleTimes.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatMultipleTimes.adbc.diagnostics new file mode 100644 index 0000000..3fbb28b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatMultipleTimes.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPEAT(\"Zone\", CAST(3 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatOnce.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatOnce.adbc.diagnostics new file mode 100644 index 0000000..9875791 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatOnce.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPEAT(\"Zone\", CAST(1 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatZeroTimes.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatZeroTimes.adbc.diagnostics new file mode 100644 index 0000000..e274f3e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextRepeatZeroTimes.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPEAT(\"Zone\", CAST(0 as INTEGER)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceEmptyString.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceEmptyString.adbc.diagnostics new file mode 100644 index 0000000..344f038 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceEmptyString.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPLACE(\"Zone\", CAST('' as VARCHAR), CAST('X' as VARCHAR)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceMultipleTimes.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceMultipleTimes.adbc.diagnostics new file mode 100644 index 0000000..7a8260b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceMultipleTimes.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPLACE(concat(\"Zone\", \"Zone\"), \"Zone\", CAST('X' as VARCHAR)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceOnce.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceOnce.adbc.diagnostics new file mode 100644 index 0000000..289a043 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceOnce.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPLACE(\"Zone\", \"Zone\", CAST('X' as VARCHAR)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceSubstringNotPresent.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceSubstringNotPresent.adbc.diagnostics new file mode 100644 index 0000000..08071a9 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceSubstringNotPresent.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPLACE(\"Zone\", CAST('NotPresent' as VARCHAR), CAST('X' as VARCHAR)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceWithEmptyString.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceWithEmptyString.adbc.diagnostics new file mode 100644 index 0000000..2db6932 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextReplaceWithEmptyString.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", REPLACE(\"Zone\", \"Zone\", CAST('' as VARCHAR)) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimEndNoTrailingSpaces.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimEndNoTrailingSpaces.adbc.diagnostics new file mode 100644 index 0000000..107ba38 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimEndNoTrailingSpaces.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", RTRIM(\"Zone\") as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimEndTrailingSpaces.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimEndTrailingSpaces.adbc.diagnostics new file mode 100644 index 0000000..afc2af5 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimEndTrailingSpaces.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", RTRIM(concat(\"Zone\", CAST(' ' as VARCHAR))) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimStartLeadingSpaces.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimStartLeadingSpaces.adbc.diagnostics new file mode 100644 index 0000000..6fa842e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimStartLeadingSpaces.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", LTRIM(concat(CAST(' ' as VARCHAR), \"Zone\")) as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimStartNoLeadingSpaces.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimStartNoLeadingSpaces.adbc.diagnostics new file mode 100644 index 0000000..e28692b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextTrimStartNoLeadingSpaces.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", LTRIM(\"Zone\") as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextUpperConvertToUpper.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextUpperConvertToUpper.adbc.diagnostics new file mode 100644 index 0000000..2e106b9 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TextUpperConvertToUpper.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'TaxiZoneLookup' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'TaxiZoneLookup' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"Zone\", UPPER(\"Zone\") as \"C1\" from ( select \"LocationID\", \"Borough\", \"Zone\", \"service_zone\" from \"main\".\"TaxiZoneLookup\" ) as \"ITBL\" order by \"ITBL\".\"LocationID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_EndOfHour.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_EndOfHour.adbc.diagnostics new file mode 100644 index 0000000..88c1099 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_EndOfHour.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(hour, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_datetime\") + 1 as BIGINT) * interval 1 hour) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(hour, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_datetime\") + 1 as BIGINT) * interval 1 hour) - interval 1 second as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Hour.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Hour.adbc.diagnostics new file mode 100644 index 0000000..9444cd7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Hour.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", hour(\"lpep_pickup_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Minute.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Minute.adbc.diagnostics new file mode 100644 index 0000000..79cae2d --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Minute.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", minute(\"lpep_pickup_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Second.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Second.adbc.diagnostics new file mode 100644 index 0000000..b0914c7 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_Second.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", second(\"lpep_pickup_datetime\") as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_StartOfHour.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_StartOfHour.adbc.diagnostics new file mode 100644 index 0000000..4a0c069 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TimeFunctions_over_Datetime_StartOfHour.adbc.diagnostics @@ -0,0 +1,26 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(hour, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_datetime\") as BIGINT) * interval 1 hour) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"lpep_pickup_datetime\", date_add(cast('2000-01-01 00:00:00.000' as TIMESTAMP), cast(date_diff(hour, cast('2000-01-01 00:00:00.000' as TIMESTAMP), \"lpep_pickup_datetime\") as BIGINT) * interval 1 hour) as \"C1\" from \"main\".\"NycTaxiData\" order by \"RecordID\" LIMIT 1" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\" from \"main\".\"NycTaxiData\"" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TransformToInt32Type.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TransformToInt32Type.adbc.diagnostics new file mode 100644 index 0000000..577cb8b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TransformToInt32Type.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\", cast(\"trip_distance\" as BIGINT) as \"C1\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TransformToInt64Type.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TransformToInt64Type.adbc.diagnostics new file mode 100644 index 0000000..577cb8b --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/TransformToInt64Type.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"C1\" from ( select \"RecordID\", \"VendorID\", \"lpep_pickup_datetime\", \"lpep_dropoff_datetime\", \"store_and_fwd_flag\", \"RatecodeID\", \"PULocationID\", \"DOLocationID\", \"passenger_count\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\", \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\", \"trip_type\", \"congestion_surcharge\", cast(\"trip_distance\" as BIGINT) as \"C1\" from \"main\".\"NycTaxiData\" ) as \"ITBL\" order by \"ITBL\".\"RecordID\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDecimalPrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDecimalPrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDecimalPrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDefault.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDefault.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDefault.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDoublePrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDoublePrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_AddDoublePrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDecimalPrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDecimalPrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDecimalPrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDefault.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDefault.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDefault.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDoublePrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDoublePrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_CompareDoublePrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDecimalPrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDecimalPrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDecimalPrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDefault.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDefault.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDefault.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDoublePrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDoublePrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_DivideDoublePrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDecimalPrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDecimalPrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDecimalPrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDefault.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDefault.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDefault.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDoublePrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDoublePrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_MultiplyDoublePrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDecimalPrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDecimalPrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDecimalPrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDefault.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDefault.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDefault.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDoublePrecision.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDoublePrecision.adbc.diagnostics new file mode 100644 index 0000000..fd77fe1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_SubtractDoublePrecision.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_ValueAs.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_ValueAs.adbc.diagnostics new file mode 100644 index 0000000..f9db873 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_ValueAs.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\", \"passenger_count\" as \"C1\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_ValueReplaceType.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_ValueReplaceType.adbc.diagnostics new file mode 100644 index 0000000..f9db873 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ValueFunctions_ValueReplaceType.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiData' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiData' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"passenger_count\", \"total_amount\", \"passenger_count\" as \"C1\" from \"main\".\"NycTaxiData\" order by \"total_amount\" desc LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ViewQuery.adbc.diagnostics b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ViewQuery.adbc.diagnostics new file mode 100644 index 0000000..9b90b49 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Diagnostics/Standard/ViewQuery.adbc.diagnostics @@ -0,0 +1,20 @@ +[ + { + "Command": "SHOW DATABASES" + }, + { + "Command": "SELECT schema_name AS Name FROM information_schema.schemata WHERE catalog_name = 'TPC-H-small' AND schema_name <> 'information_schema'" + }, + { + "Command": "SELECT table_name AS Name, table_type FROM information_schema.tables WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main'" + }, + { + "Command": "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_catalog = 'TPC-H-small' AND table_schema = 'main' AND table_name = 'NycTaxiSummary' ORDER BY ordinal_position" + }, + { + "Command": "SELECT kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name AND tc.table_catalog = kcu.table_catalog AND tc.table_schema = kcu.table_schema AND tc.table_name = kcu.table_name WHERE tc.constraint_type = 'PRIMARY KEY' AND tc.table_catalog = 'TPC-H-small' AND tc.table_schema = 'main' AND tc.table_name = 'NycTaxiSummary' ORDER BY kcu.ordinal_position" + }, + { + "Command": "select \"RecordID\", \"VendorID\", \"fare_amount\", \"tip_amount\", \"total_amount\", \"lpep_pickup_datetime\" from \"main\".\"NycTaxiSummary\" LIMIT 1" + } +] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/ParameterQueries/DuckDb.parameterquery.pq b/samples/DuckDbFlightSQL/Tests/ParameterQueries/DuckDb.parameterquery.pq new file mode 100644 index 0000000..dfdd53c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/ParameterQueries/DuckDb.parameterquery.pq @@ -0,0 +1,14 @@ +let + Source = DuckDb.Contents("localhost:31337", "Disabled", null), + database = Source{[Name = "TPC-H-small", Kind = "Database"]}[Data], + main_Schema = database{[Name = "main", Kind = "Schema"]}[Data], + misc_table = main_Schema{[Name = "misc_table", Kind = "Table"]}[Data], + nyctaxidata_Table = main_Schema{[Name = "NycTaxiData", Kind = "Table"]}[Data], + taxizonelookup_Table = main_Schema{[Name = "TaxiZoneLookup", Kind = "Table"]}[Data], + taxidate_Table = main_Schema{[Name = "NycTaxiDateData", Kind = "Table"]}[Data], + textSamples_Table = main_Schema{[Name = "TEXT_SAMPLES", Kind = "Table"]}[Data], + extendedTypes_Table = main_Schema{[Name = "ExtendedTypes", Kind = "Table"]}[Data], + nestedTypes_Table = main_Schema{[Name = "NestedTypes", Kind = "Table"]}[Data], + nycTaxiSummary_View = main_Schema{[Name = "NycTaxiSummary", Kind = "View"]}[Data] +in + [zone_table = taxizonelookup_Table, taxi_table = nyctaxidata_Table, taxi_date_table = taxidate_Table, text_samples_table = textSamples_Table, misc_table = misc_table, extended_types_table = extendedTypes_Table, nested_types_table = nestedTypes_Table, taxi_summary_view = nycTaxiSummary_View] \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/PerfSettings/perfSettings.json b/samples/DuckDbFlightSQL/Tests/PerfSettings/perfSettings.json new file mode 100644 index 0000000..da502f1 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/PerfSettings/perfSettings.json @@ -0,0 +1,16 @@ +{ + "ExtensionPaths": ["../../bin/AnyCPU/Debug/DuckDb.mez"], + "ShowProgressBars": true, + "ShowConsoleColors": true, + "EnableDiagnostics": true, + "WarmupCount": 2, + "RunCount": 3, + "Scenarios": [ + { + "Name": "Duck Db Query NycTaxi", + "QueryFilePath": "../TestSuites/PerfTests/DuckDbNycTaxi.query.pq", + "EvaluatorMode": "SinglePartition", + "ExpectedRowCount": 10000 + } + ] +} diff --git a/samples/DuckDbFlightSQL/Tests/RunDuckDbPerfTestsGuide.md b/samples/DuckDbFlightSQL/Tests/RunDuckDbPerfTestsGuide.md new file mode 100644 index 0000000..abc45c9 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/RunDuckDbPerfTestsGuide.md @@ -0,0 +1,109 @@ +# Running DuckDB Performance Tests with PQPerf + +This guide explains how to run the DuckDB FlightSQL connector performance tests using the **PQPerf** command-line tool from the Power Query SDK Tools package. These tests measure query evaluation throughput over the NYC Taxi dataset (10,000 rows) via the ADBC/FlightSQL transport. + +## Prerequisites + +1. **PQPerf.exe** — included in the `Microsoft.PowerQuery.SdkTools` NuGet package under the `tools/` folder. +2. **Built connector** — ensure `DuckDb.mez` exists at `bin/AnyCPU/Debug/DuckDb.mez`. Build it by running from the repo root: + ```powershell + dotnet build DuckDb.proj + ``` +3. **Credentials** — set up DuckDB connector credentials via the **Power Query: Set Credential** VS Code command. The connector uses `UsernamePassword` authentication. +4. **Test data** — a `sqlflite` Docker container must be running on `localhost:31337` with the test data loaded. See [Test Data Setup](#test-data-setup) below. + +## Test Data Setup + +Start the `sqlflite` Docker container, then run the data loading script: + +```powershell +cd Tests/TestSuites/Setup +./load_test_data.ps1 -DataDir "/testframework/data" +``` + +This creates 7 tables and 1 view in the `TPC-H-small` database: + +| Table | Rows | Description | +| ----------------- | ------ | -------------------------------------------------------------- | +| `NycTaxiData` | 10,000 | Trip data with mixed types (TIMESTAMP, DECIMAL, BOOLEAN, etc.) | +| `NycTaxiDateData` | 10,000 | Trip data with DATE columns | +| `TaxiZoneLookup` | 265 | Zone reference data | +| `misc_table` | 1 | Mixed precision types for edge-case testing | +| `TEXT_SAMPLES` | 1 | Text operation samples | +| `ExtendedTypes` | 1 | Extended scalar types (HUGEINT, UUID, JSON, BLOB) | +| `NestedTypes` | 1 | Nested/complex types (ARRAY, STRUCT) | +| `NycTaxiSummary` | 10,000 | View over NycTaxiData | + +## Performance Settings + +The test configuration is in `Tests/PerfSettings/perfSettings.json`: + +### Key Configuration Fields + +| Field | Description | +| ------------------ | ----------------------------------------------------------- | +| `ExtensionPaths` | Path to the DuckDB `.mez` connector file | +| `WarmupCount` | Number of warmup iterations before measurement (default: 2) | +| `RunCount` | Number of measured iterations (default: 3) | +| `EvaluatorMode` | Evaluation mode — `SinglePartition` for these tests | +| `ExpectedRowCount` | Expected number of rows returned by the query | + +## Test Scenario + +| Scenario | Protocol | Rows | Query File | +| --------------------- | ---------------- | ------ | --------------------------------------------- | +| Duck Db Query NycTaxi | ADBC (FlightSQL) | 10,000 | `TestSuites/PerfTests/DuckDbNycTaxi.query.pq` | + +## Running Tests + +Open a PowerShell terminal and navigate to the perf settings folder: + +```powershell +$PQPerfExe = "\tools\PQPerf.exe" +cd Tests\PerfSettings +``` + +### Run the perf test + +```powershell +& $PQPerfExe run-perf -sf .\perfSettings.json +``` + +## Sample Output + +```text + - Perf Runs: + - Name: Duck Db Query NycTaxi + - Query File Path: ../TestSuites/PerfTests/DuckDbNycTaxi.query.pq + - Evaluator Mode: SinglePartition + - Expected Row Count: 10000 + - Warmups: + [##################################################] 10000/10000 X.XXs + - Run: 1, Elapsed Time: 00:00:XX.XXXXXXX, Returned Row Count: 10000 + [##################################################] 10000/10000 X.XXs + - Run: 2, Elapsed Time: 00:00:XX.XXXXXXX, Returned Row Count: 10000 + + - PerfRuns: + [##################################################] 10000/10000 X.XXs + - Run: 1, Elapsed Time: 00:00:XX.XXXXXXX, Returned Row Count: 10000 + [##################################################] 10000/10000 X.XXs + - Run: 2, Elapsed Time: 00:00:XX.XXXXXXX, Returned Row Count: 10000 + [##################################################] 10000/10000 X.XXs + - Run: 3, Elapsed Time: 00:00:XX.XXXXXXX, Returned Row Count: 10000 + + - Average Evaluation Result: + - Row Count: 10000 + - Average Duration: 00:00:XX.XXXXXXX + - Average Working Set: XXXXXXXXX + - Average Total Processor Time: 00:00:XX.XXXXXXX + + - Summary: + - ScenarioName: Duck Db Query NycTaxi + - Row Count: 10000 + - Status: Success + - Average Duration: 00:00:XX.XXXXXXX +``` + +## More Information + +- [Test Data Setup](TestSuites/Setup/readme.md) — Docker container setup and data loading diff --git a/samples/DuckDbFlightSQL/Tests/RunDuckDbTestsWithVSCodeGuide.md b/samples/DuckDbFlightSQL/Tests/RunDuckDbTestsWithVSCodeGuide.md new file mode 100644 index 0000000..01140b5 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/RunDuckDbTestsWithVSCodeGuide.md @@ -0,0 +1,51 @@ +# Running DuckDB Tests with VS Code + +This guide explains how to run DuckDB connector tests using the **PQTest VS Code Test Explorer integration** provided by the Power Query SDK extension. This feature allows you to discover, run, and debug tests directly from the VS Code UI. + +## Prerequisites + +1. **DuckDB FlightSQL server** running on `localhost:31337` with test data loaded. See [Test Data Setup](TestSuites/Setup/readme.md) for instructions. +2. **Power Query SDK extension** installed in VS Code. + +## Setup + +1. **Open the Connector Folder:** + - Open the `DuckDb` folder as your **root workspace** in VS Code. + +2. **Configuration:** + - The folder should be configured with a `.vscode/settings.json` file that points to: + - **Extension Path:** `bin/AnyCPU/Debug/DuckDb.mez` + - **Settings File:** `./Tests/Settings` + +3. **Build:** + - Build the connector so the `.mez` file exists at the expected path: + ```powershell + dotnet build DuckDb.proj + ``` + +4. **Credentials:** + - Set up credentials using the **Power Query: Set Credential** command in VS Code. See [Set Credential documentation](https://learn.microsoft.com/en-us/power-query/power-query-sdk-vs-code#set-credential) for details. + - Use `UsernamePassword` authentication with the credentials from the [Connection Details](TestSuites/Setup/readme.md#connection-details). + +## Running Tests + +1. Open the **Test Explorer** view in VS Code. +2. You will see the settings files located in `Tests/Settings`: + - `DuckDbSanitySettings` — basic connectivity and schema tests + - `DuckDbStandardSettings` — full functional and query folding test suite + - `DuckDbDatasourceSpecificSettings` — DuckDB-specific tests +3. Click the "Run" icon to execute tests. + +## Running Tests from the Command Line + +You can also run tests using PQTest directly: + +```powershell +cd Tests/Settings +& '\tools\PQTest.exe' compare --extension ..\..\bin\AnyCPU\Debug\DuckDb.mez --settingsFile duckdbstandardsettings.testsettings.json -p +``` + +## More Information + +- [Test Data Setup](TestSuites/Setup/readme.md) — Docker container setup and data loading +- [Running Performance Tests](RunDuckDbPerfTestsGuide.md) — performance testing with PQPerf diff --git a/samples/DuckDbFlightSQL/Tests/Settings/DuckDbDatasourceSpecificSettings.testsettings.json b/samples/DuckDbFlightSQL/Tests/Settings/DuckDbDatasourceSpecificSettings.testsettings.json new file mode 100644 index 0000000..5a99657 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Settings/DuckDbDatasourceSpecificSettings.testsettings.json @@ -0,0 +1,6 @@ +{ + "FailOnMissingOutputFile": true, + "QueryFilePath": "../TestSuites/DatasourceSpecific", + "ParameterQueryFilePath": "../ParameterQueries/DuckDb.parameterquery.pq", + "DiagnosticsFolderPath": "../Diagnostics/Standard" +} diff --git a/samples/DuckDbFlightSQL/Tests/Settings/DuckDbSanitySettings.testsettings.json b/samples/DuckDbFlightSQL/Tests/Settings/DuckDbSanitySettings.testsettings.json new file mode 100644 index 0000000..67a8a28 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Settings/DuckDbSanitySettings.testsettings.json @@ -0,0 +1,6 @@ +{ + "FailOnMissingOutputFile": true, + "QueryFilePath": "../../../../testframework/tests/TestSuites/Sanity", + "ParameterQueryFilePath": "../ParameterQueries/DuckDb.parameterquery.pq", + "DiagnosticsFolderPath": "../Diagnostics/Sanity" +} diff --git a/samples/DuckDbFlightSQL/Tests/Settings/DuckDbStandardSettings.testsettings.json b/samples/DuckDbFlightSQL/Tests/Settings/DuckDbStandardSettings.testsettings.json new file mode 100644 index 0000000..c316411 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/Settings/DuckDbStandardSettings.testsettings.json @@ -0,0 +1,10 @@ +{ + "FailOnMissingOutputFile": true, + "QueryFilePath": "../../../../testframework/tests/TestSuites/Standard", + "ParameterQueryFilePath": "../ParameterQueries/DuckDb.parameterquery.pq", + "DiagnosticsFolderPath": "../Diagnostics/Standard", + "TestFilters": [ + "!Text/TextMiddleWithNegativeLength.query.pq", + "!DateTime/DateTimeArithmetic.query.pq" + ] +} diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ExtendedTypes.query.pq b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ExtendedTypes.query.pq new file mode 100644 index 0000000..708e069 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ExtendedTypes.query.pq @@ -0,0 +1,6 @@ +(parameter) => +let + T = parameter[extended_types_table], + T1 = Table.FirstN(T, 1) +in + T1 \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ExtendedTypes.query.pqout b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ExtendedTypes.query.pqout new file mode 100644 index 0000000..4fe2c0c --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ExtendedTypes.query.pqout @@ -0,0 +1 @@ +#table( type table [HugeIntCol = number, UuidCol = text, JsonCol = text, BlobCol = binary] , {{1234567890123456, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "{""key"": ""value"", ""num"": 42}", #binary({72, 54, 53, 54, 67, 54, 67, 54, 70} ) } } ) \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/NestedTypes.query.pq b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/NestedTypes.query.pq new file mode 100644 index 0000000..f272612 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/NestedTypes.query.pq @@ -0,0 +1,6 @@ +(parameter) => +let + T = parameter[nested_types_table], + T1 = Table.FirstN(T, 1) +in + T1 \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/NestedTypes.query.pqout b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/NestedTypes.query.pqout new file mode 100644 index 0000000..7d7ee11 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/NestedTypes.query.pqout @@ -0,0 +1 @@ +#table( type table [ArrayCol = any, StructCol = any] , {{{1, 2, 3} , [ name = "Alice", age = 30 ] } } ) \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/TextMiddleWithNegativeLength.query.pq b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/TextMiddleWithNegativeLength.query.pq new file mode 100644 index 0000000..127dd47 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/TextMiddleWithNegativeLength.query.pq @@ -0,0 +1,10 @@ +// Excluded from Standard because DuckDB handles negative length differently than test suite expects +// Expected value is an empty string and DuckDB wraps around negative length +(parameter) => +let + T2 = Table.Sort(parameter[zone_table], "LocationID"), + T3 = Table.FirstN(T2, 1), + TA = Table.SelectColumns(T3,{"Zone"}), + T4 = Table.AddColumn(TA, "withNegativeLength", each Text.Middle([Zone], 3, -1)) +in + T4 \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/TextMiddleWithNegativeLength.query.pqout b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/TextMiddleWithNegativeLength.query.pqout new file mode 100644 index 0000000..3081049 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/TextMiddleWithNegativeLength.query.pqout @@ -0,0 +1,3 @@ +#table( type table [Zone = text, withNegativeLength = any] , { + {"Newark Airport", "w"} +}) \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ViewQuery.query.pq b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ViewQuery.query.pq new file mode 100644 index 0000000..65ddc16 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ViewQuery.query.pq @@ -0,0 +1,6 @@ +(parameter) => +let + T = parameter[taxi_summary_view], + T1 = Table.FirstN(T, 1) +in + T1 \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ViewQuery.query.pqout b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ViewQuery.query.pqout new file mode 100644 index 0000000..1618dcb --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/DatasourceSpecific/ViewQuery.query.pqout @@ -0,0 +1 @@ +#table( type table [RecordID = number, VendorID = number, fare_amount = number, tip_amount = number, total_amount = number, lpep_pickup_datetime = datetime] , {{55340, 2, 7.90, 1.88, 11.28, #datetime(2023, 2, 26, 18, 57, 56)} } ) \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/PerfTests/DuckDbNycTaxi.query.pq b/samples/DuckDbFlightSQL/Tests/TestSuites/PerfTests/DuckDbNycTaxi.query.pq new file mode 100644 index 0000000..f199c48 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/PerfTests/DuckDbNycTaxi.query.pq @@ -0,0 +1,7 @@ +let + Source = DuckDb.Contents("localhost:31337", "Disabled", null), + database = Source{[Name = "TPC-H-small", Kind = "Database"]}[Data], + main_Schema = database{[Name = "main", Kind = "Schema"]}[Data], + nyctaxidata_Table = main_Schema{[Name = "NycTaxiData", Kind = "Table"]}[Data] +in + nyctaxidata_Table \ No newline at end of file diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/Setup/load_test_data.ps1 b/samples/DuckDbFlightSQL/Tests/TestSuites/Setup/load_test_data.ps1 new file mode 100644 index 0000000..06d0e4e --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/Setup/load_test_data.ps1 @@ -0,0 +1,169 @@ +# load_test_data.ps1 +# Loads PQ SDK test framework data into the SQLFlite DuckDB Docker container. +# Uses varied DuckDB types (signed/unsigned integers, FLOAT/DOUBLE, DECIMAL, etc.) +# to maximize connector type coverage. + +param( + [Parameter(Mandatory=$true)] + [string]$DataDir, + [string]$ContainerName = "sqlflite", + [string]$ServerHost = "localhost", + [int]$ServerPort = 31337, + [string]$Username = "sqlflite_username", + [string]$Password = "sqlflite_password" +) + +$ErrorActionPreference = "Stop" + +# --- Helper: run SQL via sqlflite_client inside the container --- +function Invoke-FlightSQL { + param( + [string]$Query, + [string]$Description + ) + Write-Host " $Description" -ForegroundColor Yellow + $result = docker exec $ContainerName sqlflite_client ` + --command Execute ` + --host $ServerHost ` + --port $ServerPort ` + --username $Username ` + --password $Password ` + --query "$Query" 2>&1 + if ($LASTEXITCODE -ne 0) { + Write-Error "SQL failed: $result" + exit 1 + } + return $result +} + +# ============================================================ +# Phase 1: Verify container is running +# ============================================================ +Write-Host "`n=== Phase 1: Verifying container ===" -ForegroundColor Green +$container = docker ps --filter "name=$ContainerName" --format "{{.Names}}" 2>&1 +if ($container -ne $ContainerName) { + Write-Error "Container '$ContainerName' is not running. Start it first with:`n docker run --name sqlflite --detach --rm --tty --init --publish 31337:31337 --env TLS_ENABLED=0 --env SQLFLITE_PASSWORD=sqlflite_password --env PRINT_QUERIES=1 --pull missing voltrondata/sqlflite:latest" + exit 1 +} +Write-Host " Container '$ContainerName' is running." -ForegroundColor Yellow + +# ============================================================ +# Phase 2: Copy CSV files into the container +# ============================================================ +Write-Host "`n=== Phase 2: Copying data files into container ===" -ForegroundColor Green +docker exec $ContainerName mkdir -p /tmp/testdata + +$csvFiles = @( + "nyc_taxi_tripdata.csv", + "nyc_taxi_trip_date_data.csv", + "taxi+_zone_lookup.csv", + "misc_table.csv" +) + +foreach ($file in $csvFiles) { + $sourcePath = Join-Path $DataDir $file + if (-not (Test-Path $sourcePath)) { + Write-Error "File not found: $sourcePath" + exit 1 + } + Write-Host " Copying $file..." -ForegroundColor Yellow + docker cp "$sourcePath" "${ContainerName}:/tmp/testdata/$file" + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to copy $file into container." + exit 1 + } +} +Write-Host " All files copied." -ForegroundColor Yellow + +# ============================================================ +# Phase 3: Create tables and load data +# ============================================================ +Write-Host "`n=== Phase 3: Creating tables and loading data ===" -ForegroundColor Green + +# --- NycTaxiData --- +Write-Host "`n [NycTaxiData]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "DROP TABLE IF EXISTS NycTaxiData" -Description "Dropping existing table..." +Invoke-FlightSQL -Query "CREATE TABLE NycTaxiData (RecordID INTEGER, VendorID TINYINT, lpep_pickup_datetime TIMESTAMP, lpep_dropoff_datetime TIMESTAMP, store_and_fwd_flag BOOLEAN, RatecodeID UTINYINT, PULocationID SMALLINT, DOLocationID USMALLINT, passenger_count UTINYINT, trip_distance DECIMAL(10,2), fare_amount DECIMAL(10,2), extra DECIMAL(10,2), mta_tax DECIMAL(10,2), tip_amount DECIMAL(10,2), tolls_amount DECIMAL(10,2), ehail_fee DECIMAL(10,2), improvement_surcharge DECIMAL(10,2), total_amount DECIMAL(10,2), payment_type TINYINT, trip_type UTINYINT, congestion_surcharge DECIMAL(10,2))" -Description "Creating table..." +Invoke-FlightSQL -Query "INSERT INTO NycTaxiData SELECT * FROM read_csv('/tmp/testdata/nyc_taxi_tripdata.csv', auto_detect=true)" -Description "Loading data..." + +# --- NycTaxiDateData --- +Write-Host "`n [NycTaxiDateData]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "DROP TABLE IF EXISTS NycTaxiDateData" -Description "Dropping existing table..." +Invoke-FlightSQL -Query "CREATE TABLE NycTaxiDateData (RecordID UBIGINT NOT NULL, lpep_pickup_date DATE NOT NULL, lpep_dropoff_date DATE)" -Description "Creating table..." +Invoke-FlightSQL -Query "INSERT INTO NycTaxiDateData SELECT * FROM read_csv('/tmp/testdata/nyc_taxi_trip_date_data.csv', auto_detect=true)" -Description "Loading data..." + +# --- TaxiZoneLookup --- +Write-Host "`n [TaxiZoneLookup]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "DROP TABLE IF EXISTS TaxiZoneLookup" -Description "Dropping existing table..." +Invoke-FlightSQL -Query "CREATE TABLE TaxiZoneLookup (LocationID USMALLINT, Borough VARCHAR, Zone VARCHAR, service_zone VARCHAR)" -Description "Creating table..." +Invoke-FlightSQL -Query "INSERT INTO TaxiZoneLookup SELECT * FROM read_csv('/tmp/testdata/taxi+_zone_lookup.csv', auto_detect=true)" -Description "Loading data..." + +# --- misc_table --- +Write-Host "`n [misc_table]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "DROP TABLE IF EXISTS misc_table" -Description "Dropping existing table..." +Invoke-FlightSQL -Query "CREATE TABLE misc_table (DATETIMEFIELD TIMESTAMP, BOOLEANFIELD BOOLEAN, BIGNUMERICFIELD DECIMAL(38,18), NUMERICFIELD DECIMAL(12,6), INTEGERFIELD SMALLINT, STRINGFIELD VARCHAR)" -Description "Creating table..." +Invoke-FlightSQL -Query "INSERT INTO misc_table SELECT * FROM read_csv('/tmp/testdata/misc_table.csv', auto_detect=true)" -Description "Loading data..." + +# --- TEXT_SAMPLES --- +Write-Host "`n [TEXT_SAMPLES]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "DROP TABLE IF EXISTS TEXT_SAMPLES" -Description "Dropping existing table..." +Invoke-FlightSQL -Query "CREATE TABLE TEXT_SAMPLES (TEXTCOLUMN VARCHAR(255))" -Description "Creating table..." +Invoke-FlightSQL -Query "INSERT INTO TEXT_SAMPLES VALUES ('Email ''text'': user@example.com')" -Description "Loading data..." + +# --- ExtendedTypes --- +Write-Host "`n [ExtendedTypes]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "DROP TABLE IF EXISTS ExtendedTypes" -Description "Dropping existing table..." +Invoke-FlightSQL -Query "CREATE TABLE ExtendedTypes (HugeIntCol HUGEINT, UuidCol UUID, JsonCol JSON, BlobCol BLOB)" -Description "Creating table..." +Invoke-FlightSQL -Query "INSERT INTO ExtendedTypes VALUES (1234567890123456::HUGEINT, 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{""key"": ""value"", ""num"": 42}', '\x48656C6C6F'::BLOB)" -Description "Loading data..." + +# --- NestedTypes --- +Write-Host "`n [NestedTypes]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "DROP TABLE IF EXISTS NestedTypes" -Description "Dropping existing table..." +Invoke-FlightSQL -Query "CREATE TABLE NestedTypes (ArrayCol INTEGER[], StructCol STRUCT(name VARCHAR, age INTEGER))" -Description "Creating table..." +Invoke-FlightSQL -Query "INSERT INTO NestedTypes VALUES ([1, 2, 3], {'name': 'Alice', 'age': 30})" -Description "Loading data..." + +# --- NycTaxiSummary (view) --- +Write-Host "`n [NycTaxiSummary (view)]" -ForegroundColor Cyan +Invoke-FlightSQL -Query "CREATE OR REPLACE VIEW NycTaxiSummary AS SELECT RecordID, VendorID, fare_amount, tip_amount, total_amount, lpep_pickup_datetime FROM NycTaxiData" -Description "Creating view..." + +# ============================================================ +# Phase 4: Verify loaded data +# ============================================================ +Write-Host "`n=== Phase 4: Verifying loaded data ===" -ForegroundColor Green + +$tables = @( + @{ Name = "NycTaxiData"; ExpectedRows = 10000 }, + @{ Name = "NycTaxiDateData"; ExpectedRows = 10000 }, + @{ Name = "TaxiZoneLookup"; ExpectedRows = 265 }, + @{ Name = "misc_table"; ExpectedRows = 1 }, + @{ Name = "TEXT_SAMPLES"; ExpectedRows = 1 }, + @{ Name = "ExtendedTypes"; ExpectedRows = 1 }, + @{ Name = "NestedTypes"; ExpectedRows = 1 }, + @{ Name = "NycTaxiSummary"; ExpectedRows = 10000 } +) + +$allPassed = $true +foreach ($table in $tables) { + $result = Invoke-FlightSQL -Query "SELECT COUNT(*) AS cnt FROM $($table.Name)" -Description "Counting rows in $($table.Name)..." + # Extract the count value from sqlflite_client output (e.g. "cnt: [\n 10000\n ]") + $resultText = ($result | Out-String) + if ($resultText -match "cnt:\s*\[\s*(\d+)\s*\]") { + $actualCount = [int]$Matches[1] + if ($actualCount -eq $table.ExpectedRows) { + Write-Host " OK: $actualCount rows" -ForegroundColor Green + } else { + Write-Host " FAIL: Expected $($table.ExpectedRows) rows, got $actualCount" -ForegroundColor Red + $allPassed = $false + } + } else { + Write-Host " FAIL: Could not parse row count from output" -ForegroundColor Red + $allPassed = $false + } +} + +if ($allPassed) { + Write-Host "`n=== All tables loaded and verified successfully! ===" -ForegroundColor Green +} else { + Write-Host "`n=== Some verifications failed. Check output above. ===" -ForegroundColor Red + exit 1 +} diff --git a/samples/DuckDbFlightSQL/Tests/TestSuites/Setup/readme.md b/samples/DuckDbFlightSQL/Tests/TestSuites/Setup/readme.md new file mode 100644 index 0000000..35e92b9 --- /dev/null +++ b/samples/DuckDbFlightSQL/Tests/TestSuites/Setup/readme.md @@ -0,0 +1,82 @@ +# DuckDB FlightSQL Server Setup & Test Data Loading + +## Prerequisites + +- [Docker Desktop for Windows](https://www.docker.com/products/docker-desktop/) installed and running +- Test data CSV files from the [DataConnectors test framework](../../../../../testframework/data): + - `nyc_taxi_tripdata.csv` + - `nyc_taxi_trip_date_data.csv` + - `taxi+_zone_lookup.csv` + - `misc_table.csv` + +## Step 1: Start the SQLFlite Docker Container + +Follow the instructions in the [sqlflite README](https://github.com/voltrondata/sqlflite#option-1---running-from-the-published-docker-image) to start a DuckDB FlightSQL server. + +For local testing with TLS disabled it would look something like this: + +```powershell +docker run --name sqlflite --detach --rm --tty --init --publish 31337:31337 --env TLS_ENABLED="0" --env SQLFLITE_PASSWORD="sqlflite_password" --env PRINT_QUERIES="1" --pull missing voltrondata/sqlflite:latest +``` + +Verify it's running: + +```powershell +docker ps --filter name=sqlflite +``` + +## Step 2: Load Test Data + +Run the data loading script, passing the path to the directory containing the CSV files: + +```powershell +cd Tests/TestSuites/Setup +./load_test_data.ps1 -DataDir "/testframework/data" +``` + +This script: + +1. Copies 4 CSV files into the Docker container +2. Creates 7 tables and 1 view with varied DuckDB types (TINYINT, UTINYINT, SMALLINT, USMALLINT, INTEGER, UBIGINT, DECIMAL, BOOLEAN, TIMESTAMP, DATE, VARCHAR, HUGEINT, UUID, JSON, ARRAY, STRUCT, BLOB) +3. Loads the data and verifies row counts + +### Tables Created + +| Table | Rows | Description | +| ----------------- | ------ | ------------------------------------------------------------------------------------------------------- | +| `NycTaxiData` | 10,000 | Trip data with mixed types (TINYINT, TIMESTAMP, BOOLEAN, DECIMAL, etc.) | +| `NycTaxiDateData` | 10,000 | Trip data with UBIGINT and DATE columns | +| `TaxiZoneLookup` | 265 | Zone reference data (USMALLINT, VARCHAR) | +| `misc_table` | 1 | Mixed precision types (DECIMAL(38,18), DECIMAL(12,6), SMALLINT) | +| `TEXT_SAMPLES` | 1 | Text operation samples (VARCHAR(255)) | +| `ExtendedTypes` | 1 | Extended scalar types (HUGEINT, UUID, JSON, BLOB) | +| `NestedTypes` | 1 | Nested/complex types (ARRAY, STRUCT) | +| `NycTaxiSummary` | 10,000 | View over NycTaxiData (RecordID, VendorID, fare_amount, tip_amount, total_amount, lpep_pickup_datetime) | + +## Step 3: Verify Setup + +After the script completes, you should see: + +```text +=== All tables loaded and verified successfully! === +``` + +You can also verify by running the functional test suite. See [Running DuckDB Tests with VS Code](../../RunDuckDbTestsWithVSCodeGuide.md) for the recommended approach using the VS Code Test Explorer. + +Alternatively, run tests manually with PQTest: + +```powershell +cd Tests/Settings +& '\tools\PQTest.exe' compare --extension ..\..\bin\AnyCPU\Debug\DuckDb.mez --settingsFile duckdbsanitysettings.testsettings.json -p +``` + +## Connection Details + +| Setting | Value | +| -------- | ------------------- | +| Host | `localhost:31337` | +| TLS | Disabled | +| Username | `sqlflite_username` | +| Password | `sqlflite_password` | +| Database | `TPC-H-small` | +| Schema | `main` | diff --git a/samples/DuckDbFlightSQL/TypeInfo.pqm b/samples/DuckDbFlightSQL/TypeInfo.pqm new file mode 100644 index 0000000..f4e7fee --- /dev/null +++ b/samples/DuckDbFlightSQL/TypeInfo.pqm @@ -0,0 +1,45 @@ +// TypeInfo.pqm — DuckDb native type definitions for the FlightSQL ADBC connector. +// Defines the type mapping between DuckDb native types and Power Query M types. +let + GetNumberLiteral = (value as number) => Number.ToText(value), + GetTimeLiteral = (value as time) => Time.ToText(value, [Format = "HH:mm:ss.FFFFFFF"]), + GetDateLiteral = (value as date) => Date.ToText(value, [Format = "yyyy-MM-dd"]), + GetDateTimeLiteral = (value as datetime) as text => + DateTime.ToText(value, [Format = "yyyy-MM-dd HH:mm:ss.FFFFFFF"]), + GetStringLiteral = (value as text) as text => Text.Format("#{0}#{1}#{2}", {"'", value, "'"}), + + TypeInfo = Table.FromRecords( + { + [Name = "BOOLEAN", SqlType = -7, Type = Logical.Type, Unsigned = false, ColumnSize = 1, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = null, LiteralPrefix = null, LiteralSuffix = null], + [Name = "TINYINT", SqlType = -6, Type = Int8.Type, Unsigned = false, ColumnSize = 3, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "SMALLINT", SqlType = 5, Type = Int16.Type, Unsigned = false, ColumnSize = 5, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "INTEGER", SqlType = 4, Type = Int32.Type, Unsigned = false, ColumnSize = 10, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "INT", SqlType = 4, Type = Int32.Type, Unsigned = false, ColumnSize = 10, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "BIGINT", SqlType = -5, Type = Int64.Type, Unsigned = false, ColumnSize = 19, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "HUGEINT", SqlType = 2, Type = Decimal.Type, Unsigned = false, ColumnSize = 38, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "UTINYINT", SqlType = -6, Type = Int16.Type, Unsigned = true, ColumnSize = 3, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "USMALLINT", SqlType = 5, Type = Int32.Type, Unsigned = true, ColumnSize = 5, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "UINTEGER", SqlType = 4, Type = Int64.Type, Unsigned = true, ColumnSize = 10, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "UBIGINT", SqlType = -5, Type = Decimal.Type, Unsigned = true, ColumnSize = 20, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "UHUGEINT", SqlType = 2, Type = Decimal.Type, Unsigned = true, ColumnSize = 39, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "FLOAT", SqlType = 7, Type = Single.Type, Unsigned = false, ColumnSize = 24, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 2, LiteralPrefix = null, LiteralSuffix = null], + [Name = "DOUBLE", SqlType = 8, Type = Double.Type, Unsigned = false, ColumnSize = 53, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 2, LiteralPrefix = null, LiteralSuffix = null], + [Name = "DECIMAL", SqlType = 3, Type = Decimal.Type, Unsigned = false, ColumnSize = 38, GetLiteral = GetNumberLiteral, Searchable = 2, NumberPrecisionRadix = 10, LiteralPrefix = null, LiteralSuffix = null], + [Name = "DATE", SqlType = 91, Type = Date.Type, Unsigned = false, ColumnSize = 10, GetLiteral = GetDateLiteral, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "TIME", SqlType = 92, Type = Time.Type, Unsigned = false, ColumnSize = 18, GetLiteral = GetTimeLiteral, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "TIMESTAMP", SqlType = 93, Type = DateTime.Type, Unsigned = false, ColumnSize = 29, GetLiteral = GetDateTimeLiteral, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "TIMESTAMP WITH TIME ZONE", SqlType = 93, Type = DateTimeZone.Type, Unsigned = false, ColumnSize = 35, GetLiteral = GetDateTimeLiteral, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "VARCHAR", SqlType = 12, Type = Text.Type, Unsigned = false, ColumnSize = 65535, GetLiteral = GetStringLiteral, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "CHAR", SqlType = 1, Type = Text.Type, Unsigned = false, ColumnSize = 255, GetLiteral = GetStringLiteral, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "BLOB", SqlType = -4, Type = Binary.Type, Unsigned = false, ColumnSize = 2147483647, GetLiteral = null, Searchable = 0, NumberPrecisionRadix = null, LiteralPrefix = null, LiteralSuffix = null], + [Name = "BINARY", SqlType = -3, Type = Binary.Type, Unsigned = false, ColumnSize = 32767, GetLiteral = null, Searchable = 0, NumberPrecisionRadix = null, LiteralPrefix = "0x", LiteralSuffix = null], + [Name = "UUID", SqlType = 12, Type = Text.Type, Unsigned = false, ColumnSize = 36, GetLiteral = GetStringLiteral, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "JSON", SqlType = 12, Type = Text.Type, Unsigned = false, ColumnSize = 65535, GetLiteral = null, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "INTERVAL", SqlType = 12, Type = Text.Type, Unsigned = false, ColumnSize = 65535, GetLiteral = null, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "ARRAY", SqlType = 12, Type = Text.Type, Unsigned = false, ColumnSize = 65535, GetLiteral = null, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "STRUCT", SqlType = 12, Type = Text.Type, Unsigned = false, ColumnSize = 65535, GetLiteral = null, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"], + [Name = "MAP", SqlType = 12, Type = Text.Type, Unsigned = false, ColumnSize = 65535, GetLiteral = null, Searchable = 3, NumberPrecisionRadix = null, LiteralPrefix = "'", LiteralSuffix = "'"] + } + ) +in + TypeInfo diff --git a/samples/DuckDbFlightSQL/resources.resx b/samples/DuckDbFlightSQL/resources.resx new file mode 100644 index 0000000..7488983 --- /dev/null +++ b/samples/DuckDbFlightSQL/resources.resx @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + DuckDb (FlightSQL) + + + Connect to a DuckDb instance via FlightSQL + + + DuckDb (FlightSQL) + + + Connect to a DuckDb instance via the FlightSQL (gRPC) protocol using ADBC. + +