Skip to content
Closed
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
maropu committed Dec 28, 2017
commit 1e13b702185246dc509847fc152a68cfe8f2c954
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ object TypeCoercion {
p transformExpressionsUp {
// Skip nodes if unresolved or empty children
case c @ Concat(children) if !c.childrenResolved || children.isEmpty => c

case c @ Concat(children) if conf.concatBinaryAsString ||
!children.map(_.dataType).forall(_ == BinaryType) =>
val newChildren = c.children.map { e =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ select left(null, -2), left("abcd", -2), left("abcd", 0), left("abcd", 'a');
select right("abcd", 2), right("abcd", 5), right("abcd", '2'), right("abcd", null);
select right(null, -2), right("abcd", -2), right("abcd", 0), right("abcd", 'a');

-- turn on concatBinaryAsString
-- turn off concatBinaryAsString
set spark.sql.function.concatBinaryAsString=false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turn on?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since most of other dbms-like systems concat binary inputs as binary, IMO turning off by default is okay to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant you said turn on in the comment (L28).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh....


-- Check if catalyst combine nested `Concat`s if concatBinaryAsString=false
Expand Down