goldmedal commented on issue #12415:
URL: https://github.com/apache/datafusion/issues/12415#issuecomment-2356397593

   I plan to create a directory to collect all the string-related tests. The 
structure would like
   ```
   test_files
       - string
           - init_data.slt.part
           - string_query.slt.part
           - string.slt
           - string_view.slt
           - large_string.slt
   ```
   The purpose of each file:
   - `init_data.slt.part`: To generate the common testing data to ensure every 
derived test file uses the same data.
   ```
   statement ok
   create table test_source as values
     ('Andrew', 'X', 'datafusion📊🔥', '融'),
     ('Xiangpeng', 'Xiangpeng', 'datafusion数据融合', 'datafusion数据融合'),
     ('Raphael', 'R', 'datafusionДатаФусион', 'аФус'),
     (NULL, 'R', NULL, '🔥');
   ```
   
   - `string_query.slt.part`: To collect all the tests for string-like type 
(string, largestring and StringView)
   All the tests will be based on a `test` table like
   ```
   # select all
   query TTTT
   SELECT ascii_1, ascii_2, unicode_1, unicode_2 FROM test
   ----
   Andrew X datafusion📊🔥 融
   Xiangpeng Xiangpeng datafusion数据融合 datafusion数据融合
   Raphael R datafusionДатаФусион аФус
   NULL R NULL 🔥
   ```
   
   The original test case in 
`datafusion/sqllogictest/test_files/string_view.slt` is complete for many 
string scenarios. I'll follow it to implement the common tests and add some 
scalar function tests.
   
   - `string.slt`, `string_view.slt` and `large_string.slt`: They are the main 
entrypoint of sqllogictests. The structure would like
   ```
   # init the testing data
   include ./init_data.slt.part
   
   # create the testing table required by the common tests
   statement ok
   create table test as
   select
       arrow_cast(column1, 'Utf8') as ascii_1,
       arrow_cast(column2, 'Utf8') as ascii_2,
       arrow_cast(column3, 'Utf8') as unicode_1,
       arrow_cast(column4, 'Utf8') as unicode_2
   from test_source;
   
   # common tests for string-like functions and operators
   include ./string_query.slt.part
   
   # type specific tests
   ...
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to