Code Monkey home page Code Monkey logo

Comments (3)

jinmingjian avatar jinmingjian commented on May 27, 2024

@whjpji thanks, this seems string literal handling problem. Let's fix!

from tensorbase.

frank-king avatar frank-king commented on May 27, 2024

This is caused by fee911c#diff-7e3045dfedcbf998dd7fe82a9c43989c11678cd970c88b571f82a92284aaac16 (see below). It works if I revert the patch.

@jinmingjian Could you please tell me the reason why this change is undid after introduced by 8657b53#diff-d39e44a629780cf9d813c70da62a65754b9e39c69cba1cb454c6a84a6849faa4?

If it was not a mistake during refactoring, I guess it breaks the original logics dealing with strings in A-DF. Should we have a discussion of how to deal with the strings which differ in encoding between CH and A-DF?

diff --git a/arrow-datafusion/datafusion/src/logical_plan/expr.rs b/crates/datafusion/src/logical_plan/expr.rs
rename from arrow-datafusion/datafusion/src/logical_plan/expr.rs
rename to crates/datafusion/src/logical_plan/expr.rs
--- a/arrow-datafusion/datafusion/src/logical_plan/expr.rs	(revision ca023f93d64d13ba36df89301faaa4c79fffeec6)
+++ b/crates/datafusion/src/logical_plan/expr.rs	(revision fee911c0b97ea1f75b1ca1bc50e58eee93c911b1)
@@ -1061,23 +1061,13 @@
 
 impl Literal for &str {
     fn lit(&self) -> Expr {
-        //FIXME debug_assert!(self.len()<128);
-        let mut s = String::new();
-        debug_assert!(self.len()<128);
-        s.push(self.len() as u8 as char);
-        s.push_str(self);
-        Expr::Literal(ScalarValue::LargeUtf8(Some(s)))
+        Expr::Literal(ScalarValue::LargeUtf8(Some((*self).to_owned())))
     }
 }
 
 impl Literal for String {
     fn lit(&self) -> Expr {
-        //FIXME debug_assert!(self.len()<128);
-        let mut s = String::new();
-        debug_assert!(self.len()<128);
-        s.push(self.len() as u8 as char);
-        s.push_str(self);
-        Expr::Literal(ScalarValue::LargeUtf8(Some(s)))
+        Expr::Literal(ScalarValue::LargeUtf8(Some((*self).to_owned())))
     }
 }

from tensorbase.

jinmingjian avatar jinmingjian commented on May 27, 2024

@whjpji sorry, this addition is the first hack-in. But for the latter, I remove these addition. That's we should not modify the string in this place.

from tensorbase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.