Class DictionaryToRawIndexConverter
- java.lang.Object
-
- org.apache.pinot.tools.segment.converter.DictionaryToRawIndexConverter
-
public class DictionaryToRawIndexConverter extends Object
Class to convert segment with dictionary encoded column to raw index (without dictionary).
-
-
Constructor Summary
Constructors Constructor Description DictionaryToRawIndexConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconvert()Method to perform the conversion for a set of segments in the_dataDirbooleanconvertSegment(File segmentDir, String[] columns, File outputDir, boolean compressOutput)This method converts the specified columns of the given segment from dictionary encoded forward index to raw index without dictionary.static voidmain(String[] args)Main method for the class.voidprintUsage()Helper method to print usage at the command line interface.DictionaryToRawIndexConvertersetColumns(String columns)Setter for columns to convert.DictionaryToRawIndexConvertersetDataDir(String dataDir)Setter for_dataDirDictionaryToRawIndexConvertersetOutputDir(String outputDir)Setter for_outputDirDictionaryToRawIndexConvertersetOverwrite(boolean overwrite)Setter for_overwriteWhen set to true, already existing output directory is overwritten.
-
-
-
Method Detail
-
setDataDir
public DictionaryToRawIndexConverter setDataDir(String dataDir)
Setter for_dataDir- Parameters:
dataDir- Data directory containing un-tarred segments.- Returns:
- this
-
setOutputDir
public DictionaryToRawIndexConverter setOutputDir(String outputDir)
Setter for_outputDir- Parameters:
outputDir- Directory where output segments should be written- Returns:
- this
-
setColumns
public DictionaryToRawIndexConverter setColumns(String columns)
Setter for columns to convert.- Parameters:
columns- Comma separated list of columns- Returns:
- this
-
setOverwrite
public DictionaryToRawIndexConverter setOverwrite(boolean overwrite)
Setter for_overwriteWhen set to true, already existing output directory is overwritten.- Parameters:
overwrite- True for overwriting existing output dir, False otherwise- Returns:
- this
-
convert
public boolean convert() throws ExceptionMethod to perform the conversion for a set of segments in the_dataDir- Returns:
- True if successful, False otherwise
- Throws:
Exception
-
convertSegment
public boolean convertSegment(File segmentDir, String[] columns, File outputDir, boolean compressOutput) throws Exception
This method converts the specified columns of the given segment from dictionary encoded forward index to raw index without dictionary.- Parameters:
segmentDir- Segment directorycolumns- Columns to convertoutputDir- Directory for writing output segmentcompressOutput- Tar/gzip the output segment- Returns:
- True if successful, False otherwise
- Throws:
Exception
-
printUsage
public void printUsage()
Helper method to print usage at the command line interface.
-
-