hu6360567 opened a new issue, #399:
URL: https://github.com/apache/arrow-datafusion-python/issues/399
**Describe the bug**
fail to execute sql when select with column if the column contains
capitalized letter
**To Reproduce**
```python
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
--
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]