All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickzetta.platform.schema.Schema Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.platform.schema;

import com.clickzetta.platform.common.ColumnSchema;
import com.clickzetta.platform.operator.Bytes;
import com.clickzetta.platform.operator.PartialRow;

import java.util.List;
import java.util.Map;

public interface Schema {

  List getColumns();

  int getVarLengthColumnCount();

  int getVarLengthColumnOffsetToAllVarCharColumns(int columnIndex);

  int getRowSize();

  default int getRowSize(List columns) {
    int totalSize = 0;
    boolean hasNullables = false;
    for (ColumnSchema column : columns) {
      totalSize += column.getTypeSize();
      hasNullables |= column.isNullable();
    }
    if (hasNullables) {
      totalSize += Bytes.getBitSetSize(columns.size());
    }
    return totalSize;
  }

  int getColumnOffset(int idx);

  boolean hasColumn(String columnName);

  int getColumnIndex(String columnName);

  int getColumnIndex(int columnId);

  ColumnSchema getColumnByIndex(int idx);

  ColumnSchema getColumn(String columnName);

  int getColumnCount();

  int getPrimaryKeyColumnCount();

  List getPrimaryKeyColumns();

  List getKeyColumns();

  List getSortColumns();

  Map getPrimaryKeyIndexMap();

  Map getKeyIndexMap();

  Map getSortIndexMap();

  com.clickzetta.platform.common.Schema getRowKeyProjection();

  boolean hasNullableColumns();

  boolean hasColumnIds();

  int getColumnId(String columnName);

  PartialRow newPartialRow();

  boolean hasIsDeleted();

  int getIsDeletedIndex();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy