io.deephaven.client.impl.SchemaAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-java-client-flight Show documentation
Show all versions of deephaven-java-client-flight Show documentation
The Deephaven client flight library
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.client.impl;
import io.deephaven.qst.column.header.ColumnHeader;
import io.deephaven.qst.table.TableHeader;
import org.apache.arrow.vector.types.pojo.Field;
import org.apache.arrow.vector.types.pojo.Schema;
import java.util.ArrayList;
import java.util.List;
/**
* Utilities for creating {@link Schema}.
*/
public class SchemaAdapter {
/**
* Convert a {@code header} into a {@link Schema}.
*
* @param header the header
* @return the schema
*/
public static Schema of(TableHeader header) {
final List fields = new ArrayList<>(header.numColumns());
for (ColumnHeader> columnHeader : header) {
fields.add(FieldAdapter.of(columnHeader));
}
return new Schema(fields);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy