Skip to content
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

[GLUTEN-8956][VL] Add support for casting binary to string #8957

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArnavBalyan
Copy link
Contributor

What changes were proposed in this pull request?

  • Binary to string currently falls back.
  • Offload it to Gluten.

How was this patch tested?

  • Unit Tests

@github-actions github-actions bot added the VELOX label Mar 11, 2025
Copy link

#8956

@ArnavBalyan ArnavBalyan force-pushed the arnavb/cast-varbin-string branch from 7659f0f to e2f1275 Compare March 11, 2025 05:32
@@ -249,6 +249,9 @@ bool SubstraitToVeloxPlanValidator::isAllowedCast(const TypePtr& fromType, const
// 3. Timestamp to most categories except few supported types is not allowed.
// 4. Certain complex types are not allowed.

auto fromKind = fromType->kind();
Copy link
Contributor

Choose a reason for hiding this comment

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

fromKind is not used in anywhere.

import org.apache.spark.sql.types._

class VeloxCastSuite extends VeloxWholeStageTransformerSuite with ExpressionEvalHelper {
def cast(v: Any, targetType: DataType, timeZoneId: Option[String] = None): Cast = {
Copy link
Contributor

Choose a reason for hiding this comment

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

timeZoneId is not used. Maybe you can pass a const value to function 'Cast()'.

def cast(v: Any, targetType: DataType, timeZoneId: Option[String] = None): Cast = {
v match {
case lit: Expression =>
logDebug(s"Cast from: ${lit.dataType.typeName}, to: ${targetType.typeName}")
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not better to add logs in a unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants