Describe the bug
fail to execute sql when select with column if the column contains capitalized letter
To Reproduce
import pyarrow as pa
import datafusion
if __name__ == "__main__":
tbl = pa.Table.from_arrays([[1, 2, 3]], names=["id"])
for column_name in ["id", "ID", "iD"]:
ctx = datafusion.SessionContext()
ctx.register_record_batches(name="tbl", partitions=[tbl.rename_columns([column_name]).to_batches()])
sql = f"SELECT {column_name} from tbl"
try:
print(sql)
ctx.sql(sql)
except Exception as e:
print(e)
SELECT id from tbl
SELECT ID from tbl
DataFusion error: SchemaError(FieldNotFound { field: Column { relation: None, name: "id" }, valid_fields: [Column { relation: Some(Bare { table: "tbl" }), name: "ID" }] })
SELECT iD from tbl
DataFusion error: SchemaError(FieldNotFound { field: Column { relation: None, name: "id" }, valid_fields: [Column { relation: Some(Bare { table: "tbl" }), name: "iD" }] })
Expected behavior
All sql should executed successfully.
Additional context
Python 3.8.16
pyarrow 12.0.0
datafusion 23.0.0
Describe the bug
fail to execute sql when select with column if the column contains capitalized letter
To Reproduce
Expected behavior
All sql should executed successfully.
Additional context
Python 3.8.16
pyarrow 12.0.0
datafusion 23.0.0