Skip to content

Commit

Permalink
HIVE-4123 Improved ORC integer RLE version 2. (Prasanth Jayachandran via
Browse files Browse the repository at this point in the history
omalley)


git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1513155 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
omalley committed Aug 12, 2013
1 parent db27260 commit 69deabe
Show file tree
Hide file tree
Showing 19 changed files with 4,724 additions and 246 deletions.
3 changes: 3 additions & 0 deletions common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ public static enum ConfVars {

// Maximum fraction of heap that can be used by ORC file writers
HIVE_ORC_FILE_MEMORY_POOL("hive.exec.orc.memory.pool", 0.5f), // 50%
// use 0.11 version of RLE encoding. if this conf is not defined or any
// other value specified, ORC will use the new RLE encoding
HIVE_ORC_WRITE_FORMAT("hive.exec.orc.write.format", "0.11"),

HIVE_ORC_DICTIONARY_KEY_SIZE_THRESHOLD("hive.exec.orc.dictionary.key.size.threshold", 0.8f),

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions ql/src/java/org/apache/hadoop/hive/ql/io/orc/IntegerReader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hadoop.hive.ql.io.orc;

import java.io.IOException;

/**
* Interface for reading integers.
*/
interface IntegerReader {

/**
* Seek to the position provided by index.
* @param index
* @throws IOException
*/
void seek(PositionProvider index) throws IOException;

/**
* Skip number of specified rows.
* @param numValues
* @throws IOException
*/
void skip(long numValues) throws IOException;

/**
* Check if there are any more values left.
* @return
* @throws IOException
*/
boolean hasNext() throws IOException;

/**
* Return the next available value.
* @return
* @throws IOException
*/
long next() throws IOException;
}
47 changes: 47 additions & 0 deletions ql/src/java/org/apache/hadoop/hive/ql/io/orc/IntegerWriter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.hadoop.hive.ql.io.orc;

import java.io.IOException;

/**
* Interface for writing integers.
*/
interface IntegerWriter {

/**
* Get position from the stream.
* @param recorder
* @throws IOException
*/
void getPosition(PositionRecorder recorder) throws IOException;

/**
* Write the integer value
* @param value
* @throws IOException
*/
void write(long value) throws IOException;

/**
* Flush the buffer
* @throws IOException
*/
void flush() throws IOException;
}
Loading

0 comments on commit 69deabe

Please sign in to comment.