diff --git a/java/src/main/java/ai/rapids/cudf/Schema.java b/java/src/main/java/ai/rapids/cudf/Schema.java index 63446ca2305..d782839d686 100644 --- a/java/src/main/java/ai/rapids/cudf/Schema.java +++ b/java/src/main/java/ai/rapids/cudf/Schema.java @@ -31,7 +31,7 @@ public class Schema { private static final int UNKNOWN_PRECISION = -1; private final DType topLevelType; - private final int precision; // storing precision for decimal types + private final int topLevelPrecision; // only applicable if the top level is a decimal type private final List childNames; private final List childSchemas; private boolean flattened = false; @@ -40,14 +40,12 @@ public class Schema { private int[] flattenedCounts; private int[] flattenedPrecisions; - - private Schema(DType topLevelType, - int precision, + int topLevelPrecision, List childNames, List childSchemas) { this.topLevelType = topLevelType; - this.precision = precision; + this.topLevelPrecision = topLevelPrecision; this.childNames = childNames; this.childSchemas = childSchemas; } @@ -63,7 +61,7 @@ private Schema(DType topLevelType, */ private Schema() { topLevelType = null; - precision = UNKNOWN_PRECISION; + topLevelPrecision = UNKNOWN_PRECISION; childNames = null; childSchemas = null; } @@ -152,7 +150,7 @@ private int collectFlattened(String[] names, DType[] types, int[] counts, int[] Schema child = childSchemas.get(i); names[offset] = childNames.get(i); types[offset] = child.topLevelType; - precisions[offset] = child.precision; + precisions[offset] = child.topLevelPrecision; if (child.childNames != null) { counts[offset] = child.childNames.size(); } else { @@ -340,9 +338,9 @@ public static class Builder { private final List names; private final List types; - private Builder(DType topLevelType, int precision) { + private Builder(DType topLevelType, int topLevelPrecision) { this.topLevelType = topLevelType; - this.topLevelPrecision = precision; + this.topLevelPrecision = topLevelPrecision; if (topLevelType == DType.STRUCT || topLevelType == DType.LIST) { // There can be children names = new ArrayList<>();