Diveyam Mishra created CALCITE-7462:
---------------------------------------

             Summary:  Support custom field delimiters in the CSV adapter
                 Key: CALCITE-7462
                 URL: https://issues.apache.org/jira/browse/CALCITE-7462
             Project: Calcite
          Issue Type: Improvement
            Reporter: Diveyam Mishra


Currently, the Calcite CSV adapter (`CsvTableFactory`, etc.) hardcodes the 
comma (`,`) as the field separator. This prevents users from mapping schemas to 
other popular delimited format types, such as pipe-separated (`|`) or 
tab-separated (`\t`) files.
 
This improvement introduces support for a `separator` property in the model 
JSON's operand map for the CSV adapter.
 
Example Usage:
{
 "version": "1.0",
 "defaultSchema": "TEST",
 "schemas": [
 {
 "name": "TEST",
 "type": "custom",
 "factory": "org.apache.calcite.adapter.file.CsvTableFactory",
 "operand": {
 "file": "data.csv",
 "separator": "|"
 }
 }
 ]
}
 
If no separator is provided in the model JSON, the adapter defaults to the 
standard comma (`,`) character, strictly preserving backward compatibility.

(PS: doing this for the first time so make sure to tell me if something else is 
needed )



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to