You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can not handle ' characters in PARTITIONED BY clause #9714
Before this pull request, there was a problem with how escape characters in the PARTITIONED BY clause were processed in both the CREATE EXTERNAL TABLE and COPY TO statements. The issue stemmed from converting the Value to a string too early in the parsing process, leading to errors.
Although it appears that the test passes, in reality, during the execution of CREATE EXTERNAL TABLE, the specified field names do not match as expected, indicating a silent error. This issue should be addressed separately, as it falls outside the scope of the current PR.
I propose that we standardize the approach to handling column names in both the schema definitions and the PARTITIONED BY clauses. Once we establish a consistent method, the relevance of this test can be reassessed.
So this will not convert the Ident value to string too early, but I also doubt whether it would fix this. I encountered similar issue related to ' characters in my past experience and it's a bit tricky.
Activity
yyy1000 commentedon Mar 26, 2024
I'd like to try this, from the description,
So maybe trying to make
partition byuseColumnDef, currently, my plan is:table_partition_colsfield in https://github.com/apache/arrow-datafusion/blob/39f4aaf5cd1abfc9204c3eb96effdb4ebcf5b882/datafusion/sql/src/parser.rs#L206CreateExternalTablestatement toVec<ColumnRef>parse_partitionsreturnColumnReflikeparse_columns. https://github.com/apache/arrow-datafusion/blob/39f4aaf5cd1abfc9204c3eb96effdb4ebcf5b882/datafusion/sql/src/parser.rs#L542external_table_to_plan, do the same thing totable_partition_colslikecolumn_defaultshttps://github.com/apache/arrow-datafusion/blob/39f4aaf5cd1abfc9204c3eb96effdb4ebcf5b882/datafusion/sql/src/statement.rs#L984-L987So this will not convert the Ident value to string too early, but I also doubt whether it would fix this. I encountered similar issue related to
'characters in my past experience and it's a bit tricky.alamb commentedon Mar 27, 2024
@metesynnada I wonder if you have any thoughts on the suggestion above from @yyy1000 ?
metesynnada commentedon Mar 27, 2024
I believe this is a good start.