Skip to content

Commit

Permalink
Fix Schema.Builder does not propagate precision value to Builder
Browse files Browse the repository at this point in the history
…instance (#17214)

When calling `Schema.Builder.build()`, the value `topLevelPrecision` should be passed into the constructor of the `Schema` class. However, it was forgotten.

Authors:
  - Nghia Truong (https://github.com/ttnghia)

Approvers:
  - Robert (Bobby) Evans (https://github.com/revans2)

URL: #17214
ttnghia authored Oct 31, 2024
1 parent e512258 commit 9657c9a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions java/src/main/java/ai/rapids/cudf/Schema.java
Original file line number Diff line number Diff line change
@@ -36,13 +36,13 @@ public class Schema {
private static final int UNKNOWN_PRECISION = -1;

/**
* Store precision for the top level column, only applicable if the column is a decimal type.
* <p/>
* This variable is not designed to be used by any libcudf's APIs since libcudf does not support
* precisions for fixed point numbers.
* Instead, it is used only to pass down the precision values from Spark's DecimalType to the
* JNI level, where some JNI functions require these values to perform their operations.
*/
* Store precision for the top level column, only applicable if the column is a decimal type.
* <p/>
* This variable is not designed to be used by any libcudf's APIs since libcudf does not support
* precisions for fixed point numbers.
* Instead, it is used only to pass down the precision values from Spark's DecimalType to the
* JNI level, where some JNI functions require these values to perform their operations.
*/
private final int topLevelPrecision;

private final List<String> childNames;
@@ -429,7 +429,7 @@ public Schema build() {
children.add(b.build());
}
}
return new Schema(topLevelType, names, children);
return new Schema(topLevelType, topLevelPrecision, names, children);
}
}
}

0 comments on commit 9657c9a

Please sign in to comment.