public class Schema extends Object
修饰符和类型 | 类和描述 |
---|---|
static class |
Schema.Builder |
修饰符和类型 | 方法和描述 |
---|---|
HostColumnVector.DataType |
asHostDataType() |
static Schema.Builder |
builder() |
Schema |
getChild(int i)
获取子元素的模式。
|
DType[] |
getChildTypes()
获取模式中顶级子列的类型。
|
String[] |
getColumnNames()
获取模式中顶级子列的名称。
|
String[] |
getFlattenedColumnNames()
通过深度优先遍历获取模式中所有层级展平的列的名称。
|
int[] |
getFlattenedDecimalPrecisions()
通过深度优先遍历获取模式中所有层级展平的列类型的十进制精度。
|
int[] |
getFlattenedNumChildren()
获取模式中每个层级的子列数量。
|
int[] |
getFlattenedTypeIds()
通过深度优先遍历获取模式中所有层级展平的列的类型 ID。
|
DType[] |
getFlattenedTypes()
通过深度优先遍历获取模式中所有层级展平的列的类型。
|
int[] |
getFlattenedTypeScales()
通过深度优先遍历获取模式中所有层级展平的列类型的标度。
|
int |
getNumChildren()
获取模式中顶级子列的数量。
|
DType |
getType() |
boolean |
hasNestedChildren()
这主要用于嵌套的顶级结构体模式,但对于 CSV 之类的格式,我们关注的是它不包含任何自身也嵌套的子项。
|
boolean |
isNested()
检查模式是否嵌套(即顶级类型是 LIST 或 STRUCT)。
|
boolean |
isStructOrHasStructDescendant()
检查模式是否包含任何结构体。
|
String |
toString() |
public static final Schema INFERRED
public Schema getChild(int i)
i
- 要读取的子元素的索引。IndexOutOfBoundsException
- 如果索引不在子元素范围内。public static Schema.Builder builder()
public String[] getFlattenedColumnNames()
public String[] getColumnNames()
public boolean isNested()
public boolean hasNestedChildren()
public int[] getFlattenedTypeIds()
public int[] getFlattenedTypeScales()
public int[] getFlattenedDecimalPrecisions()
这用于将十进制精度从 Spark 仅传递给 JNI 层,其中一些 JNI 函数需要精度值来执行其操作。由于 libcudf 不支持定点数的精度,因此 libcudf 的任何 API 都不应使用十进制精度。
public DType[] getFlattenedTypes()
public DType[] getChildTypes()
public int getNumChildren()
public int[] getFlattenedNumChildren()
public DType getType()
public boolean isStructOrHasStructDescendant()
public HostColumnVector.DataType asHostDataType()
版权所有 © 2025。保留所有权利。