From 2db4365999a5e24152da59c18fb651f5cf33f67b Mon Sep 17 00:00:00 2001 From: liurenjie1024 Date: Tue, 29 Oct 2024 09:50:00 +0800 Subject: [PATCH] Remove unused --- .../nvidia/spark/rapids/jni/TableUtils.java | 58 ------------------- 1 file changed, 58 deletions(-) diff --git a/src/main/java/com/nvidia/spark/rapids/jni/TableUtils.java b/src/main/java/com/nvidia/spark/rapids/jni/TableUtils.java index 01a15bc18b..9db0be9a45 100644 --- a/src/main/java/com/nvidia/spark/rapids/jni/TableUtils.java +++ b/src/main/java/com/nvidia/spark/rapids/jni/TableUtils.java @@ -1,7 +1,5 @@ package com.nvidia.spark.rapids.jni; -import ai.rapids.cudf.*; - import java.util.Arrays; import java.util.Iterator; import java.util.function.Function; @@ -10,51 +8,6 @@ import java.util.stream.Collectors; public class TableUtils { - public static Schema schemaOf(Table t) { - Schema.Builder builder = Schema.builder(); - - for (int i = 0; i < t.getNumberOfColumns(); i++) { - ColumnVector cv = t.getColumn(i); - addToSchema(cv, "col_" + i + "_", builder); - } - - return builder.build(); - } - - public static void addToSchema(ColumnView cv, String namePrefix, Schema.Builder builder) { - toSchemaInner(cv, 0, namePrefix, builder); - } - - private static int toSchemaInner(ColumnView cv, int idx, String namePrefix, - Schema.Builder builder) { - String name = namePrefix + idx; - - Schema.Builder thisBuilder = builder.addColumn(cv.getType(), name); - int lastIdx = idx; - for (int i = 0; i < cv.getNumChildren(); i++) { - lastIdx = toSchemaInner(cv.getChildColumnView(i), lastIdx + 1, namePrefix, - thisBuilder); - } - - return lastIdx; - } - - public static void addToSchema(HostColumnVectorCore cv, String namePrefix, Schema.Builder builder) { - toSchemaInner(cv, 0, namePrefix, builder); - } - - private static int toSchemaInner(HostColumnVectorCore cv, int idx, String namePrefix, - Schema.Builder builder) { - String name = namePrefix + idx; - - Schema.Builder thisBuilder = builder.addColumn(cv.getType(), name); - int lastIdx = idx; - for (int i=0; i < cv.getNumChildren(); i++) { - lastIdx = toSchemaInner(cv.getChildColumnView(i), lastIdx + 1, namePrefix, thisBuilder); - } - - return lastIdx; - } public static void ensure(boolean condition, String message) { if (!condition) { @@ -78,17 +31,6 @@ public static long getValidityLengthInBytes(long rows) { return (rows + 7) / 8; } - /** - * This method returns the allocation size of the validity vector which is 64-byte aligned - * e.g. getValidityAllocationSizeInBytes(5) => 64 bytes - * getValidityAllocationSizeInBytes(14) => 64 bytes - * getValidityAllocationSizeInBytes(65) => 128 bytes - */ - static long getValidityAllocationSizeInBytes(long rows) { - long numBytes = getValidityLengthInBytes(rows); - return ((numBytes + 63) / 64) * 64; - } - public static T closeIfException(R resource, Function function) { try { return function.apply(resource);