New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select 'abc'
cause the server stuck
#230
Comments
@whjpji thanks, this seems string literal handling problem. Let's fix! |
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())))
}
} |
@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. |
In the current version, doing queries like
select 'abc'
returns no result:And I commented out this three lines in
engine::datafusions
:tensorbase/crates/engine/src/datafusions.rs
Lines 177 to 180 in 14e4802
The server will get stuck on this query
However, integral literals can work:
The text was updated successfully, but these errors were encountered: