congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ColumnIO.getType
Code IndexAdd Tabnine to your IDE (free)

How to use
getType
method
in
org.apache.parquet.io.ColumnIO

Best Java code snippets using org.apache.parquet.io.ColumnIO.getType (Showing top 13 results out of 315)

origin: org.lasersonlab.apache.parquet/parquet-column

void add(ColumnIO child) {
 children.add(child);
 childrenByName.put(child.getType().getName(), child);
 ++ childrenSize;
}
origin: org.apache.parquet/parquet-column

void add(ColumnIO child) {
 children.add(child);
 childrenByName.put(child.getType().getName(), child);
 ++ childrenSize;
}
origin: org.apache.parquet/parquet-column

@Override
void setLevels(int r, int d, String[] fieldPath, int[] indexFieldPath, List<ColumnIO> repetition, List<ColumnIO> path) {
 super.setLevels(r, d, fieldPath, indexFieldPath, repetition, path);
 for (ColumnIO child : this.children) {
  String[] newFieldPath = Arrays.copyOf(fieldPath, fieldPath.length + 1);
  int[] newIndexFieldPath = Arrays.copyOf(indexFieldPath, indexFieldPath.length + 1);
  newFieldPath[fieldPath.length] = child.getType().getName();
  newIndexFieldPath[indexFieldPath.length] = child.getIndex();
  List<ColumnIO> newRepetition;
  if (child.getType().isRepetition(REPEATED)) {
   newRepetition = new ArrayList<ColumnIO>(repetition);
   newRepetition.add(child);
  } else {
   newRepetition = repetition;
  }
  List<ColumnIO> newPath = new ArrayList<ColumnIO>(path);
  newPath.add(child);
  child.setLevels(
    // the type repetition level increases whenever there's a possible repetition
    child.getType().isRepetition(REPEATED) ? r + 1 : r,
    // the type definition level increases whenever a field can be missing (not required)
    !child.getType().isRepetition(REQUIRED) ? d + 1 : d,
    newFieldPath,
    newIndexFieldPath,
    newRepetition,
    newPath
    );
 }
}
origin: org.lasersonlab.apache.parquet/parquet-column

@Override
void setLevels(int r, int d, String[] fieldPath, int[] indexFieldPath, List<ColumnIO> repetition, List<ColumnIO> path) {
 super.setLevels(r, d, fieldPath, indexFieldPath, repetition, path);
 for (ColumnIO child : this.children) {
  String[] newFieldPath = Arrays.copyOf(fieldPath, fieldPath.length + 1);
  int[] newIndexFieldPath = Arrays.copyOf(indexFieldPath, indexFieldPath.length + 1);
  newFieldPath[fieldPath.length] = child.getType().getName();
  newIndexFieldPath[indexFieldPath.length] = child.getIndex();
  List<ColumnIO> newRepetition;
  if (child.getType().isRepetition(REPEATED)) {
   newRepetition = new ArrayList<ColumnIO>(repetition);
   newRepetition.add(child);
  } else {
   newRepetition = repetition;
  }
  List<ColumnIO> newPath = new ArrayList<ColumnIO>(path);
  newPath.add(child);
  child.setLevels(
    // the type repetition level increases whenever there's a possible repetition
    child.getType().isRepetition(REPEATED) ? r + 1 : r,
    // the type definition level increases whenever a field can be missing (not required)
    !child.getType().isRepetition(REQUIRED) ? d + 1 : d,
    newFieldPath,
    newIndexFieldPath,
    newRepetition,
    newPath
    );
 }
}
origin: org.apache.parquet/parquet-column

private void writeNull(ColumnIO undefinedField, int r, int d) {
 if (undefinedField.getType().isPrimitive()) {
  columnWriter[((PrimitiveColumnIO) undefinedField).getId()].writeNull(r, d);
 } else {
  GroupColumnIO groupColumnIO = (GroupColumnIO) undefinedField;
  // only cache the repetition level, the definition level should always be the definition level of the parent node
  cacheNullForGroup(groupColumnIO, r);
 }
}
origin: org.apache.parquet/parquet-thrift

private void endListWrapper() {
 if (size > 0) {
  recordConsumer.endField(listContent.getType().getName(), 0);
 }
 recordConsumer.endGroup();
 end();
}
origin: org.apache.parquet/parquet-thrift

private void startListWrapper() {
 start();
 recordConsumer.startGroup();
 if (size > 0) {
  recordConsumer.startField(listContent.getType().getName(), 0);
  currentProtocol = contentProtocol;
 }
}
origin: org.lasersonlab.apache.parquet/parquet-column

private void writeNull(ColumnIO undefinedField, int r, int d) {
 if (undefinedField.getType().isPrimitive()) {
  columnWriter[((PrimitiveColumnIO) undefinedField).getId()].writeNull(r, d);
 } else {
  GroupColumnIO groupColumnIO = (GroupColumnIO) undefinedField;
  // only cache the repetition level, the definition level should always be the definition level of the parent node
  cacheNullForGroup(groupColumnIO, r);
 }
}
origin: prestosql/presto

public static ColumnIO getArrayElementColumn(ColumnIO columnIO)
{
  while (columnIO instanceof GroupColumnIO && !columnIO.getType().isRepetition(REPEATED)) {
    columnIO = ((GroupColumnIO) columnIO).getChild(0);
  }
  /* If array has a standard 3-level structure with middle level repeated group with a single field:
   *  optional group my_list (LIST) {
   *     repeated group element {
   *        required binary str (UTF8);
   *     };
   *  }
   */
  if (columnIO instanceof GroupColumnIO &&
      columnIO.getType().getOriginalType() == null &&
      ((GroupColumnIO) columnIO).getChildrenCount() == 1 &&
      !columnIO.getName().equals("array") &&
      !columnIO.getName().equals(columnIO.getParent().getName() + "_tuple")) {
    return ((GroupColumnIO) columnIO).getChild(0);
  }
  /* Backward-compatibility support for 2-level arrays where a repeated field is not a group:
   *   optional group my_list (LIST) {
   *      repeated int32 element;
   *   }
   */
  return columnIO;
}
origin: io.prestosql/presto-parquet

public static ColumnIO getArrayElementColumn(ColumnIO columnIO)
{
  while (columnIO instanceof GroupColumnIO && !columnIO.getType().isRepetition(REPEATED)) {
    columnIO = ((GroupColumnIO) columnIO).getChild(0);
  }
  /* If array has a standard 3-level structure with middle level repeated group with a single field:
   *  optional group my_list (LIST) {
   *     repeated group element {
   *        required binary str (UTF8);
   *     };
   *  }
   */
  if (columnIO instanceof GroupColumnIO &&
      columnIO.getType().getOriginalType() == null &&
      ((GroupColumnIO) columnIO).getChildrenCount() == 1 &&
      !columnIO.getName().equals("array") &&
      !columnIO.getName().equals(columnIO.getParent().getName() + "_tuple")) {
    return ((GroupColumnIO) columnIO).getChild(0);
  }
  /* Backward-compatibility support for 2-level arrays where a repeated field is not a group:
   *   optional group my_list (LIST) {
   *      repeated int32 element;
   *   }
   */
  return columnIO;
}
origin: org.lasersonlab.apache.parquet/parquet-column

ColumnIO getParent(int r) {
 if (getRepetitionLevel() == r && getType().isRepetition(Repetition.REPEATED)) {
  return this;
 } else  if (getParent()!=null && getParent().getDefinitionLevel()>=r) {
  return getParent().getParent(r);
 } else {
  throw new InvalidRecordException("no parent("+r+") for "+Arrays.toString(this.getFieldPath()));
 }
}
origin: org.apache.parquet/parquet-column

ColumnIO getParent(int r) {
 if (getRepetitionLevel() == r && getType().isRepetition(Repetition.REPEATED)) {
  return this;
 } else  if (getParent()!=null && getParent().getDefinitionLevel()>=r) {
  return getParent().getParent(r);
 } else {
  throw new InvalidRecordException("no parent("+r+") for "+Arrays.toString(this.getFieldPath()));
 }
}
origin: prestosql/presto

  return Optional.empty();
boolean required = columnIO.getType().getRepetition() != OPTIONAL;
int repetitionLevel = columnRepetitionLevel(columnIO);
int definitionLevel = columnDefinitionLevel(columnIO);
RichColumnDescriptor column = new RichColumnDescriptor(primitiveColumnIO.getColumnDescriptor(), columnIO.getType().asPrimitiveType());
return Optional.of(new PrimitiveField(type, repetitionLevel, definitionLevel, required, column, primitiveColumnIO.getId()));
org.apache.parquet.ioColumnIOgetType

Popular methods of ColumnIO

  • getIndex
  • getParent
  • getColumnNames
  • getDefinitionLevel
  • getFieldPath
  • getFirst
  • getLast
  • getName
  • getRepetitionLevel
  • setDefinitionLevel
  • setFieldPath
  • setLevels
  • setFieldPath,
  • setLevels,
  • setRepetitionLevel

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Table (org.hibernate.mapping)
    A relational table
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now