JunRuiLee commented on code in PR #496:
URL: https://github.com/apache/paimon-rust/pull/496#discussion_r3563696033


##########
bindings/c/src/table.rs:
##########
@@ -772,8 +820,11 @@ pub unsafe extern "C" fn paimon_predicate_equal(
     table: *const paimon_table,
     column: *const std::ffi::c_char,
     datum: paimon_datum,
+    case_sensitive: bool,

Review Comment:
   Confirmed. Restored the existing `paimon_predicate_*` signatures 
(case-sensitive) and added additive `paimon_predicate_*_with_case_sensitive` 
variants, so the Go libffi CIFs in `bindings/go/predicate.go` keep matching 
with no change to the Go binding. Added compile-time signature guards (`const 
_: unsafe extern "C" fn(...) = paimon_predicate_*`) that fail the build if one 
of these symbols changes shape again. Go's own opt-in case-insensitive API is 
left to a follow-up. (36ad296)



##########
crates/integrations/datafusion/src/table/mod.rs:
##########
@@ -349,9 +353,16 @@ impl TableProvider for PaimonTableProvider {
         filters: &[Expr],
         limit: Option<usize>,
     ) -> DFResult<Arc<dyn ExecutionPlan>> {
+        // Derive column-name case sensitivity from the DataFusion session:
+        // when DataFusion normalizes (lowercases) unquoted identifiers (its
+        // default), Paimon should match case-insensitively; when normalization
+        // is off, match exactly.
+        let case_sensitive = 
!state.config_options().sql_parser.enable_ident_normalization;

Review Comment:
   Confirmed — DataFusion resolves projection/filter columns against the 
provider schema before `TableProvider::scan`, and `enable_ident_normalization` 
only lowercases unquoted identifiers rather than making schema resolution 
case-insensitive, so `SELECT name` against a `Name` field fails at planning and 
the scan-level folding is never reached. Dropped the derivation: the 
DataFusion/SQL path now always matches case-sensitively (both `scan` and the 
variant-extraction planner pass `case_sensitive = true`), with a comment 
explaining why. Added an end-to-end negative test that asserts `SELECT name` vs 
a `Name` field fails at planning, pinning this behavior. Case-insensitive 
matching stays a direct-ReadBuilder feature (core/C/Python). (36ad296)



-- 
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]

Reply via email to