Tabnine Logo
DictionaryCompressionOptimizer.estimateIndexBytesPerValue
Code IndexAdd Tabnine to your IDE (free)

How to use
estimateIndexBytesPerValue
method
in
io.prestosql.orc.DictionaryCompressionOptimizer

Best Java code snippets using io.prestosql.orc.DictionaryCompressionOptimizer.estimateIndexBytesPerValue (Showing top 8 results out of 315)

origin: io.prestosql/presto-orc

@Override
public int getIndexBytes()
{
  checkState(!directEncoded);
  return toIntExact(estimateIndexBytesPerValue(dictionary.getEntryCount()) * getNonNullValueCount());
}
origin: prestosql/presto

@Override
public int getIndexBytes()
{
  checkState(!directEncoded);
  return toIntExact(estimateIndexBytesPerValue(dictionary.getEntryCount()) * getNonNullValueCount());
}
origin: io.prestosql/presto-orc

@Override
public int getIndexBytes()
{
  return toIntExact(estimateIndexBytesPerValue(getDictionaryEntries()) * getNonNullValueCount());
}
origin: prestosql/presto

@Override
public int getIndexBytes()
{
  return toIntExact(estimateIndexBytesPerValue(getDictionaryEntries()) * getNonNullValueCount());
}
origin: io.prestosql/presto-orc

public long getBufferedBytes()
{
  if (direct) {
    return (long) (rowCount * valuesPerRow * bytesPerEntry);
  }
  int dictionaryEntries = getDictionaryEntries();
  int bytesPerValue = estimateIndexBytesPerValue(dictionaryEntries);
  return (dictionaryEntries * bytesPerEntry) + (getNonNullValueCount() * bytesPerValue);
}
origin: prestosql/presto

public long getBufferedBytes()
{
  if (direct) {
    return (long) (rowCount * valuesPerRow * bytesPerEntry);
  }
  int dictionaryEntries = getDictionaryEntries();
  int bytesPerValue = estimateIndexBytesPerValue(dictionaryEntries);
  return (dictionaryEntries * bytesPerEntry) + (getNonNullValueCount() * bytesPerValue);
}
origin: io.prestosql/presto-orc

@Test
public void testSingleDictionaryColumnByteLimit()
{
  int bytesPerEntry = 1024;
  int dictionaryEntries = 1024;
  TestDictionaryColumn column = dictionaryColumn(bytesPerEntry, dictionaryEntries);
  // construct a simulator that will hit the row limit first
  int stripeMaxBytes = megabytes(100);
  int bytesPerRow = estimateIndexBytesPerValue(dictionaryEntries);
  int expectedMaxRowCount = stripeMaxBytes / bytesPerRow;
  DataSimulator simulator = new DataSimulator(0, stripeMaxBytes, expectedMaxRowCount * 10, megabytes(16), 0, column);
  for (int loop = 0; loop < 3; loop++) {
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertEquals(simulator.getRowCount(), 0);
    assertEquals(simulator.getBufferedBytes(), 0);
    simulator.advanceToNextStateChange();
    // since there dictionary columns is only 1 MB, the simulator should advance until the strip is full
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertLessThan(simulator.getRowCount(), expectedMaxRowCount);
    simulator.finalOptimize();
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertLessThan(simulator.getRowCount(), expectedMaxRowCount);
    simulator.reset();
  }
}
origin: prestosql/presto

@Test
public void testSingleDictionaryColumnByteLimit()
{
  int bytesPerEntry = 1024;
  int dictionaryEntries = 1024;
  TestDictionaryColumn column = dictionaryColumn(bytesPerEntry, dictionaryEntries);
  // construct a simulator that will hit the row limit first
  int stripeMaxBytes = megabytes(100);
  int bytesPerRow = estimateIndexBytesPerValue(dictionaryEntries);
  int expectedMaxRowCount = stripeMaxBytes / bytesPerRow;
  DataSimulator simulator = new DataSimulator(0, stripeMaxBytes, expectedMaxRowCount * 10, megabytes(16), 0, column);
  for (int loop = 0; loop < 3; loop++) {
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertEquals(simulator.getRowCount(), 0);
    assertEquals(simulator.getBufferedBytes(), 0);
    simulator.advanceToNextStateChange();
    // since there dictionary columns is only 1 MB, the simulator should advance until the strip is full
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertLessThan(simulator.getRowCount(), expectedMaxRowCount);
    simulator.finalOptimize();
    assertFalse(simulator.isDictionaryMemoryFull());
    assertFalse(column.isDirect());
    assertGreaterThanOrEqual(simulator.getBufferedBytes(), (long) stripeMaxBytes);
    assertLessThan(simulator.getRowCount(), expectedMaxRowCount);
    simulator.reset();
  }
}
io.prestosql.orcDictionaryCompressionOptimizerestimateIndexBytesPerValue

Popular methods of DictionaryCompressionOptimizer

  • <init>
  • finalOptimize
  • isFull
  • optimize
  • reset
  • convertLowCompressionStreams
  • currentCompressionRatio
  • getDictionaryMemoryBytes
  • getMaxDirectBytes
  • selectDictionaryColumnToConvert
    Choose a dictionary column to convert to direct encoding. We do this by predicting the compression r
  • tryConvertToDirect
  • tryConvertToDirect

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Table (org.hibernate.mapping)
    A relational table
  • Github Copilot alternatives
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