Tabnine Logo
ColumnIO.getParent
Code IndexAdd Tabnine to your IDE (free)

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

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

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: org.lasersonlab.apache.parquet/parquet-column

@Override
public void endField(String field, int index) {
 if (DEBUG) log("endField({}, {})",field ,index);
 currentColumnIO = currentColumnIO.getParent();
 if (emptyField) {
  throw new ParquetEncodingException("empty fields are illegal, the field should be ommited completely instead");
 }
 fieldsWritten[currentLevel].markWritten(index);
 r[currentLevel] = currentLevel == 0 ? 0 : r[currentLevel - 1];
 if (DEBUG) printState();
}
origin: org.apache.parquet/parquet-column

@Override
public void endField(String field, int index) {
 if (DEBUG) log("endField({}, {})",field ,index);
 currentColumnIO = currentColumnIO.getParent();
 if (emptyField) {
  throw new ParquetEncodingException("empty fields are illegal, the field should be ommited completely instead");
 }
 fieldsWritten[currentLevel].markWritten(index);
 r[currentLevel] = currentLevel == 0 ? 0 : r[currentLevel - 1];
 if (DEBUG) printState();
}
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;
}
org.apache.parquet.ioColumnIOgetParent

Popular methods of ColumnIO

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

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
  • runOnUiThread (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Join (org.hibernate.mapping)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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