alamb commented on code in PR #11978:
URL: https://github.com/apache/datafusion/pull/11978#discussion_r1720038132
##########
datafusion/functions/src/string/octet_length.rs:
##########
@@ -81,12 +81,6 @@ impl ScalarUDFImpl for OctetLengthFunc {
ScalarValue::Utf8(v) =>
Ok(ColumnarValue::Scalar(ScalarValue::Int32(
v.as_ref().map(|x| x.len() as i32),
))),
- ScalarValue::LargeUtf8(v) => Ok(ColumnarValue::Scalar(
Review Comment:
I like how removing the detailed physical types on the ScalarValue makes
this kind of code much simpler (it doesn't heed to also handle two different
"types" of strings
##########
datafusion/sqllogictest/test_files/string_view.slt:
##########
@@ -270,37 +270,37 @@ explain SELECT column1_utf8 from test where 'Andrew' =
column1_utf8view;
----
logical_plan
01)Projection: test.column1_utf8
-02)--Filter: test.column1_utf8view = Utf8View("Andrew")
+02)--Filter: CAST(Utf8("Andrew") AS Utf8View) = test.column1_utf8view
03)----TableScan: test projection=[column1_utf8, column1_utf8view]
query TT
explain SELECT column1_utf8 from test where column1_utf8 =
arrow_cast('Andrew', 'Utf8View');
----
logical_plan
-01)Filter: test.column1_utf8 = Utf8("Andrew")
+01)Filter: CAST(test.column1_utf8 AS Utf8View) = CAST(Utf8("Andrew") AS
Utf8View)
Review Comment:
I think this is not a good change -- it shows the column itself being cast
(which is a substantial overhead at runtime)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]