qifanzhang-ms commented on PR #2698:
URL: https://github.com/apache/arrow-adbc/pull/2698#issuecomment-2804351948

   > > > Is there a specific multi-statement test that should be added 
(presumably from both the DriverTests and the ClientTests)?
   > > > I tried to add a test. Since our current test framework requires 
developers to write query statements in json files themselves, the added test 
would be a bit abrupt.
   > 
   > The way I would do something like this is for any environment that can 
execute a query. For example, something like:
   > 
   > ```
   >  [SkippableFact, Order(6)]
   >  public void CanExecuteMultiStatementQuery()
   >  {
   >      foreach (BigQueryTestEnvironment environment in _environments)
   >      {
   >          AdbcConnection adbcConnection = 
GetAdbcConnection(environment.Name);
   >          AdbcStatement statement = adbcConnection.CreateStatement();
   >          
   >           string query1 = "SELECT " +
   >                   "CAST(1 as INT64) as id, " +
   >                   "CAST(1.23 as FLOAT64) as number, " +
   >                   "PARSE_NUMERIC(\"4.56\") as decimal, " +
   >                   
"PARSE_BIGNUMERIC(\"7.89000000000000000000000000000000000000\") as big_decimal, 
" +
   >                   "CAST(True as BOOL) as is_active, " +
   >                   "'John Doe' as name, " +
   >                   "FROM_BASE64('YWJjMTIz') as data, " +
   >                   "CAST('2023-09-08' as DATE) as date, " +
   >                   "CAST('12:34:56' as TIME) as time, " +
   >                   "CAST('2023-09-08 12:34:56' as DATETIME) as datetime, " +
   >                   "CAST('2023-09-08 12:34:56+00:00' as TIMESTAMP) as 
timestamp, " +
   >                   "ST_GEOGPOINT(1, 2) as point, " +
   >                   "ARRAY[1, 2, 3] as numbers, " +
   >                   "STRUCT('John Doe' as name, 30 as age) as person," +
   >                   "PARSE_JSON('{\"name\":\"Jane Doe\",\"age\":29}') as 
json";
   > 
   >          string query2 = "SELECT " +
   >                    "CAST(1.7976931348623157e+308 as FLOAT64) as number, " +
   >                    
"PARSE_NUMERIC(\"9.99999999999999999999999999999999E+28\") as decimal, " +
   >                  
   >        
"PARSE_BIGNUMERIC(\"5.7896044618658097711785492504343953926634992332820282019728792003956564819968E+37\")
   > 
   >          string combinedQuery = query1 + ";" + query2 + ";"
   >          statement.SqlQuery = combinedQuery;
   > 
   >          QueryResult queryResult = statement.ExecuteQuery();
   > 
   >        // TODO: Assert the expected results from the two queries
   >      }
   >  }
   > ```
   > 
   > This will work without any tables being created and you can validate the 
result(s) of the multi-statement evaluation.
   > 
   > An alternative way could be to use the BigQuery public datasets to 
retrieve data as well.
   
   Thanks, have added.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to