diff --git a/testframework/data/PQSDKTestData.md b/testframework/data/PQSDKTestData.md index bb2551b..59c059a 100644 --- a/testframework/data/PQSDKTestData.md +++ b/testframework/data/PQSDKTestData.md @@ -15,7 +15,9 @@ The PQ SDK Test Framework dataset contains the below files: - **nyc_taxi_trip_date_data.csv** file with 10000 rows containing record identifier and two date columns processed from the February 2023 green trip data - **taxi+\_zone_lookup.csv** file which contains 265 rows from the taxi zone lookup table -- **PQSDKTestFrameworkDataSchema.sql** file contains the schema for NyxTaxiGreen and TaxiZoneLookup table +- **misc_table.csv** file with 1 row containing mixed data types (timestamp, boolean, decimal, integer, string) used + for datatype conversion tests +- **PQSDKTestFrameworkDataSchema.sql** file contains the schema for NycTaxiData, NycTaxiDateData, TaxiZoneLookup and MiscTable tables ## PQ SDK Test Framework - Data Types and Precision @@ -30,6 +32,7 @@ The schema in **PQSDKTestFrameworkDataSchema.sql** uses generic type names (`int | `timestamp` | Date and time | DATETIME, TIMESTAMP, TIMESTAMP_NTZ | | `date` | Date only | DATE | | `string` | Variable-length text | VARCHAR, NVARCHAR, TEXT | +| `decimal(p,s)` | Fixed-precision numeric with precision `p` and scale `s` | DECIMAL(p,s), NUMBER(p,s), NUMERIC(p,s) | > **Note:** All `double` columns in the **NycTaxiData** table (e.g., `trip_distance`, `fare_amount`, `total_amount`) > contain values with at most two decimal places. When choosing a data source type, either a floating-point type @@ -41,4 +44,5 @@ The PQ SDK Test Framework dataset needs to be loaded to the datasource for your PQ SDK Testframework Test Suites. The data is provided in convenient csv format so that it can be easily be loaded to any datasource. The **nyc_taxi_tripdata.csv**, **nyc_taxi_trip_date_data.csv** and **taxi+\_zone_lookup.csv** files should be respectively loaded into **NycTaxiData**, **NycTaxiDateData** and **TaxiZoneLookup** tables as per the schema -specified in the **PQSDKTestFrameworkDataSchema.sql** file. +specified in the **PQSDKTestFrameworkDataSchema.sql** file. The **misc_table.csv** file should be loaded into the +**misc_table** table using the same schema file. diff --git a/testframework/data/PQSDKTestFrameworkDataSchema.sql b/testframework/data/PQSDKTestFrameworkDataSchema.sql index 96febbd..dd1fb2a 100644 --- a/testframework/data/PQSDKTestFrameworkDataSchema.sql +++ b/testframework/data/PQSDKTestFrameworkDataSchema.sql @@ -2,7 +2,8 @@ -- two decimal places. Map 'double' to the appropriate floating-point or decimal -- type in your data source (e.g., FLOAT, DOUBLE, REAL, DECIMAL(10,2), NUMBER). -- Similarly, map 'int' to INTEGER/INT, 'boolean' to BOOLEAN/BIT, 'timestamp' to --- DATETIME/TIMESTAMP, 'date' to DATE, and 'string' to VARCHAR/NVARCHAR/TEXT as +-- DATETIME/TIMESTAMP, 'date' to DATE, 'string' to VARCHAR/NVARCHAR/TEXT, and +-- 'decimal(p,s)' to DECIMAL/NUMBER with the specified precision and scale as -- supported by your data source. CREATE TABLE NycTaxiData( @@ -41,3 +42,12 @@ CREATE TABLE TaxiZoneLookup ( Zone string, service_zone string ); + +CREATE TABLE misc_table ( + DATETIMEFIELD timestamp, + BOOLEANFIELD boolean, + BIGNUMERICFIELD decimal(38,18), + NUMERICFIELD decimal(12,6), + INTEGERFIELD int, + STRINGFIELD string +); diff --git a/testframework/data/misc_table.csv b/testframework/data/misc_table.csv new file mode 100644 index 0000000..c4e89f4 --- /dev/null +++ b/testframework/data/misc_table.csv @@ -0,0 +1,2 @@ +DATETIMEFIELD,BOOLEANFIELD,BIGNUMERICFIELD,NUMERICFIELD,INTEGERFIELD,STRINGFIELD +2025-08-05 02:30:00.000,true,123456789012345678.123456789012345678,12345.678900,931,Σ