Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev/builddep-veloxbe-inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ fi

# Step 2: Build Velox
step 2 "Building Velox (incremental)"
cmake --build "$VELOX_BUILD_DIR" -j $NUM_THREADS
cmake --build "$VELOX_BUILD_DIR" --target velox -j $NUM_THREADS
echo "[Step 2/4] Velox build complete."

# Step 3: Build Gluten C++
step 3 "Building Gluten C++ (incremental)"
cmake --build "$GLUTEN_BUILD_DIR" -j $NUM_THREADS
cmake --build "$GLUTEN_BUILD_DIR" --target gluten velox -j $NUM_THREADS
echo "[Step 3/4] Gluten C++ build complete."

# Step 4: Copy libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
package org.apache.gluten.vectorized;

import org.apache.gluten.columnarbatch.ColumnarBatches;
import org.apache.gluten.exception.GlutenException;
import org.apache.gluten.iterator.ClosableIterator;
import org.apache.gluten.runtime.Runtime;
import org.apache.gluten.runtime.RuntimeAware;

import org.apache.spark.sql.execution.datasources.SchemaColumnConvertNotSupportedException;
import org.apache.spark.sql.vectorized.ColumnarBatch;

import java.io.IOException;
Expand Down Expand Up @@ -130,6 +132,41 @@ public void requestBarrier() {
nativeRequestBarrier(iterHandle);
}

/**
* Translates a Velox type conversion error into a SchemaColumnConvertNotSupportedException.
* Returns null if the message does not indicate a type conversion error.
*/
private static RuntimeException translateToSchemaException(String msg) {
if (msg.contains("not allowed for requested type") || msg.contains("Not a valid type for")) {
return new SchemaColumnConvertNotSupportedException("unknown", msg, "unknown");
}
return null;
}

@Override
protected RuntimeException translateException(Exception e) {
String msg = findFirstNonNullMessage(e);
if (msg != null) {
RuntimeException schemaEx = translateToSchemaException(msg);
if (schemaEx != null) {
schemaEx.initCause(e);
return schemaEx;
}
}
return new GlutenException(e);
}

private static String findFirstNonNullMessage(Throwable t) {
while (t != null) {
String msg = t.getMessage();
if (msg != null) {
return msg;
}
t = t.getCause();
}
return null;
}

@Override
public void close0() {
// To make sure the outputted batches are still accessible after the iterator is closed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final boolean hasNext() {
try {
return hasNext0();
} catch (Exception e) {
throw new GlutenException(e);
throw translateException(e);
}
}

Expand All @@ -47,7 +47,7 @@ public final T next() {
try {
return next0();
} catch (Exception e) {
throw new GlutenException(e);
throw translateException(e);
}
}

Expand All @@ -63,4 +63,12 @@ public final void close() {
protected abstract boolean hasNext0() throws Exception;

protected abstract T next0() throws Exception;

/**
* Translates a native exception into an appropriate Java exception. Subclasses can override this
* to translate backend-specific exceptions into Spark-compatible exceptions.
*/
protected RuntimeException translateException(Exception e) {
return new GlutenException(e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,70 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenParquetAvroCompatibilitySuite]
enableSuite[GlutenParquetCommitterSuite]
enableSuite[GlutenParquetFieldIdSchemaSuite]
// TODO: 4.x enableSuite[GlutenParquetTypeWideningSuite] // 74 failures - MAJOR ISSUE
enableSuite[GlutenParquetTypeWideningSuite]
.exclude("parquet decimal precision change Decimal(20, 2) -> Decimal(22, 2)")
.exclude("parquet decimal precision and scale change Decimal(20, 7) -> Decimal(22, 5)")
.exclude("parquet decimal precision and scale change Decimal(20, 5) -> Decimal(22, 8)")
.exclude("parquet decimal precision and scale change Decimal(20, 2) -> Decimal(22, 4)")
.exclude("parquet decimal precision and scale change Decimal(10, 4) -> Decimal(12, 7)")
.exclude("parquet decimal precision and scale change Decimal(10, 6) -> Decimal(12, 4)")
.exclude("parquet decimal precision and scale change Decimal(10, 7) -> Decimal(5, 2)")
.exclude("parquet decimal precision and scale change Decimal(12, 4) -> Decimal(10, 2)")
.exclude("parquet decimal precision and scale change Decimal(12, 4) -> Decimal(10, 6)")
.exclude("parquet decimal precision and scale change Decimal(20, 17) -> Decimal(10, 2)")
.exclude("parquet decimal precision and scale change Decimal(20, 17) -> Decimal(5, 2)")
.exclude("parquet decimal precision and scale change Decimal(22, 4) -> Decimal(20, 2)")
.exclude("parquet decimal precision and scale change Decimal(22, 5) -> Decimal(20, 7)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(6, 4)")
.exclude("parquet decimal precision and scale change Decimal(7, 4) -> Decimal(5, 2)")
.exclude("parquet decimal precision and scale change Decimal(10, 2) -> Decimal(12, 4)")
.exclude("parquet decimal precision and scale change Decimal(10, 2) -> Decimal(20, 12)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(10, 7)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(20, 17)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(7, 4)")
.exclude("parquet decimal precision change Decimal(10, 2) -> Decimal(5, 2)")
.exclude("parquet decimal precision change Decimal(12, 2) -> Decimal(10, 2)")
.exclude("parquet decimal precision change Decimal(20, 2) -> Decimal(10, 2)")
.exclude("parquet decimal precision change Decimal(20, 2) -> Decimal(5, 2)")
.exclude("parquet decimal precision change Decimal(22, 2) -> Decimal(20, 2)")
.exclude("parquet decimal precision change Decimal(7, 2) -> Decimal(5, 2)")
.exclude("parquet decimal precision change Decimal(10, 2) -> Decimal(12, 2)")
.exclude("parquet decimal precision change Decimal(10, 2) -> Decimal(20, 2)")
.exclude("parquet decimal precision change Decimal(5, 2) -> Decimal(10, 2)")
.exclude("parquet decimal precision change Decimal(5, 2) -> Decimal(20, 2)")
.exclude("parquet decimal precision change Decimal(5, 2) -> Decimal(7, 2)")
.exclude("parquet decimal type change Decimal(5, 2) -> Decimal(3, 2) overflows with parquet-mr")
.exclude("unsupported parquet conversion ByteType -> DecimalType(1,0)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(2,0)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(3,0)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(3,1)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(4,1)")
.exclude("unsupported parquet conversion IntegerType -> DecimalType(10,1)")
.exclude("unsupported parquet conversion IntegerType -> DecimalType(5,0)")
.exclude("unsupported parquet conversion IntegerType -> DecimalType(9,0)")
.exclude("unsupported parquet conversion LongType -> DateType")
.exclude("unsupported parquet conversion LongType -> DecimalType(10,0)")
.exclude("unsupported parquet conversion LongType -> DecimalType(19,0)")
.exclude("unsupported parquet conversion LongType -> DecimalType(20,1)")
.exclude("unsupported parquet conversion LongType -> IntegerType")
.exclude("unsupported parquet conversion ShortType -> DecimalType(3,0)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(4,0)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(5,0)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(5,1)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(6,1)")
.exclude("parquet widening conversion ByteType -> DecimalType(11,1)")
.exclude("parquet widening conversion ByteType -> DecimalType(20,0)")
.exclude("parquet widening conversion IntegerType -> DecimalType(11,1)")
.exclude("parquet widening conversion IntegerType -> DecimalType(20,0)")
.exclude("parquet widening conversion IntegerType -> DecimalType(38,0)")
.exclude("parquet widening conversion IntegerType -> DoubleType")
.exclude("parquet widening conversion LongType -> DecimalType(20,0)")
.exclude("parquet widening conversion LongType -> DecimalType(21,1)")
.exclude("parquet widening conversion LongType -> DecimalType(38,0)")
.exclude("parquet widening conversion ShortType -> DecimalType(11,1)")
.exclude("parquet widening conversion ShortType -> DecimalType(20,0)")
.exclude("parquet widening conversion ShortType -> DecimalType(38,0)")
.exclude("parquet widening conversion ShortType -> DoubleType")
enableSuite[GlutenParquetVariantShreddingSuite]
// Generated suites for org.apache.spark.sql.execution.datasources.text
// TODO: 4.x enableSuite[GlutenWholeTextFileV1Suite] // 1 failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,70 @@ class VeloxTestSettings extends BackendTestSettings {
enableSuite[GlutenParquetAvroCompatibilitySuite]
enableSuite[GlutenParquetCommitterSuite]
enableSuite[GlutenParquetFieldIdSchemaSuite]
// TODO: 4.x enableSuite[GlutenParquetTypeWideningSuite] // 74 failures - MAJOR ISSUE
enableSuite[GlutenParquetTypeWideningSuite]
.exclude("parquet decimal precision change Decimal(20, 2) -> Decimal(22, 2)")
.exclude("parquet decimal precision and scale change Decimal(20, 7) -> Decimal(22, 5)")
.exclude("parquet decimal precision and scale change Decimal(20, 5) -> Decimal(22, 8)")
.exclude("parquet decimal precision and scale change Decimal(20, 2) -> Decimal(22, 4)")
.exclude("parquet decimal precision and scale change Decimal(10, 4) -> Decimal(12, 7)")
.exclude("parquet decimal precision and scale change Decimal(10, 6) -> Decimal(12, 4)")
.exclude("parquet decimal precision and scale change Decimal(10, 7) -> Decimal(5, 2)")
.exclude("parquet decimal precision and scale change Decimal(12, 4) -> Decimal(10, 2)")
.exclude("parquet decimal precision and scale change Decimal(12, 4) -> Decimal(10, 6)")
.exclude("parquet decimal precision and scale change Decimal(20, 17) -> Decimal(10, 2)")
.exclude("parquet decimal precision and scale change Decimal(20, 17) -> Decimal(5, 2)")
.exclude("parquet decimal precision and scale change Decimal(22, 4) -> Decimal(20, 2)")
.exclude("parquet decimal precision and scale change Decimal(22, 5) -> Decimal(20, 7)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(6, 4)")
.exclude("parquet decimal precision and scale change Decimal(7, 4) -> Decimal(5, 2)")
.exclude("parquet decimal precision and scale change Decimal(10, 2) -> Decimal(12, 4)")
.exclude("parquet decimal precision and scale change Decimal(10, 2) -> Decimal(20, 12)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(10, 7)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(20, 17)")
.exclude("parquet decimal precision and scale change Decimal(5, 2) -> Decimal(7, 4)")
.exclude("parquet decimal precision change Decimal(10, 2) -> Decimal(5, 2)")
.exclude("parquet decimal precision change Decimal(12, 2) -> Decimal(10, 2)")
.exclude("parquet decimal precision change Decimal(20, 2) -> Decimal(10, 2)")
.exclude("parquet decimal precision change Decimal(20, 2) -> Decimal(5, 2)")
.exclude("parquet decimal precision change Decimal(22, 2) -> Decimal(20, 2)")
.exclude("parquet decimal precision change Decimal(7, 2) -> Decimal(5, 2)")
.exclude("parquet decimal precision change Decimal(10, 2) -> Decimal(12, 2)")
.exclude("parquet decimal precision change Decimal(10, 2) -> Decimal(20, 2)")
.exclude("parquet decimal precision change Decimal(5, 2) -> Decimal(10, 2)")
.exclude("parquet decimal precision change Decimal(5, 2) -> Decimal(20, 2)")
.exclude("parquet decimal precision change Decimal(5, 2) -> Decimal(7, 2)")
.exclude("parquet decimal type change Decimal(5, 2) -> Decimal(3, 2) overflows with parquet-mr")
.exclude("unsupported parquet conversion ByteType -> DecimalType(1,0)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(2,0)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(3,0)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(3,1)")
.exclude("unsupported parquet conversion ByteType -> DecimalType(4,1)")
.exclude("unsupported parquet conversion IntegerType -> DecimalType(10,1)")
.exclude("unsupported parquet conversion IntegerType -> DecimalType(5,0)")
.exclude("unsupported parquet conversion IntegerType -> DecimalType(9,0)")
.exclude("unsupported parquet conversion LongType -> DateType")
.exclude("unsupported parquet conversion LongType -> DecimalType(10,0)")
.exclude("unsupported parquet conversion LongType -> DecimalType(19,0)")
.exclude("unsupported parquet conversion LongType -> DecimalType(20,1)")
.exclude("unsupported parquet conversion LongType -> IntegerType")
.exclude("unsupported parquet conversion ShortType -> DecimalType(3,0)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(4,0)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(5,0)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(5,1)")
.exclude("unsupported parquet conversion ShortType -> DecimalType(6,1)")
.exclude("parquet widening conversion ByteType -> DecimalType(11,1)")
.exclude("parquet widening conversion ByteType -> DecimalType(20,0)")
.exclude("parquet widening conversion IntegerType -> DecimalType(11,1)")
.exclude("parquet widening conversion IntegerType -> DecimalType(20,0)")
.exclude("parquet widening conversion IntegerType -> DecimalType(38,0)")
.exclude("parquet widening conversion IntegerType -> DoubleType")
.exclude("parquet widening conversion LongType -> DecimalType(20,0)")
.exclude("parquet widening conversion LongType -> DecimalType(21,1)")
.exclude("parquet widening conversion LongType -> DecimalType(38,0)")
.exclude("parquet widening conversion ShortType -> DecimalType(11,1)")
.exclude("parquet widening conversion ShortType -> DecimalType(20,0)")
.exclude("parquet widening conversion ShortType -> DecimalType(38,0)")
.exclude("parquet widening conversion ShortType -> DoubleType")
// TODO: 4.x enableSuite[GlutenParquetVariantShreddingSuite] // 1 failure
// Generated suites for org.apache.spark.sql.execution.datasources.text
// TODO: 4.x enableSuite[GlutenWholeTextFileV1Suite] // 1 failure
Expand Down