target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testDefaultJsonFileFormatOptions() throws Exception { JsonFileConfig fileFormat = new JsonFileConfig(); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'json'", tableOptions); } | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testDefaultParquetFileFormatOptions() throws Exception { ParquetFileConfig fileFormat = new ParquetFileConfig(); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'parquet'", tableOptions); } | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testDefaultAvroFileFormatOptions() throws Exception { AvroFileConfig fileFormat = new AvroFileConfig(); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'avro'", tableOptions); } | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testMutatorApplyNoDropNonPreview() { boolean preview = false; TransformResult result = mutator(preview).apply("foo", "foo2", newValue, false); assertEquals(newHashSet("foo2"), result.getAddedColumns()); assertEquals(newHashSet(), result.getModifiedColumns()); assertEquals(newHashSet(), result.getRemov... | public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... |
@Test public void testDefaultExcelFileFormatOptions() throws Exception { ExcelFileConfig fileFormat = new ExcelFileConfig(); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("extractHeader => false", tableOptions); assertContains("hasMergedCells => false... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testDefaultXlsFileFormatOptions() throws Exception { XlsFileConfig fileFormat = new XlsFileConfig(); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("extractHeader => false", tableOptions); assertContains("hasMergedCells => false", tab... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testSheetExcelFile() throws Exception { ExcelFileConfig fileFormat = new ExcelFileConfig(); fileFormat.setSheetName("foo"); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("xls => false", tableOptions); assertContains("sheet => 'foo'",... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testSheetExcelFileWithSingleQuote() throws Exception { ExcelFileConfig fileFormat = new ExcelFileConfig(); fileFormat.setSheetName("fo'o"); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("xls => false", tableOptions); assertContains("... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testSheetXlsFile() throws Exception { XlsFileConfig fileFormat = new XlsFileConfig(); fileFormat.setSheetName("foo"); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("xls => true", tableOptions); assertContains("sheet => 'foo'", tableO... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testExtractHeaderExcelFile() throws Exception { ExcelFileConfig fileFormat = new ExcelFileConfig(); fileFormat.setExtractHeader(true); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("xls => false", tableOptions); assertContains("extra... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testHasMergedCellsExcelFile() throws Exception { ExcelFileConfig fileFormat = new ExcelFileConfig(); fileFormat.setHasMergedCells(true); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("xls => false", tableOptions); assertContains("has... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testExtractHeaderXlsFile() throws Exception { XlsFileConfig fileFormat = new XlsFileConfig(); fileFormat.setExtractHeader(true); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("xls => true", tableOptions); assertContains("extractHeade... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test public void testHasMergedCellsXlsFile() throws Exception { XlsFileConfig fileFormat = new XlsFileConfig(); fileFormat.setHasMergedCells(true); String tableOptions = fileFormat.toTableOptions(); assertContains("type => 'excel'", tableOptions); assertContains("xls => true", tableOptions); assertContains("hasMergedC... | public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.append(format("f... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... | FileFormat { public String toTableOptions() throws IllegalArgumentException { final StringBuilder stringBuilder = new StringBuilder(); switch (getFileType()) { case TEXT: case CSV: case TSV: case PSV: final TextFileConfig textFileConfig = (TextFileConfig)this; stringBuilder.append("type => 'text', "); stringBuilder.app... |
@Test(expected = NullPointerException.class) public void testNullSegmentThrowsNPE() { PathUtils.join("", null, ""); } | public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb.length() - ... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... |
@Test public void testMutatorApplyReplaceNonPreview() { boolean preview = false; TransformResult result1 = mutator(preview).apply("foo", "foo", newValue, true); assertEquals(newHashSet(), result1.getAddedColumns()); assertEquals(newHashSet("foo"), result1.getModifiedColumns()); assertEquals(newHashSet(), result1.getRem... | public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... |
@Test public void testJoinPreservesAbsoluteOrRelativePaths() { final String actual = PathUtils.join("/a", "/b", "/c"); final String expected = "/a/b/c"; Assert.assertEquals("invalid path", expected, actual); final String actual2 = PathUtils.join("/a", "b", "c"); final String expected2 = "/a/b/c"; Assert.assertEquals("i... | public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb.length() - ... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... | PathUtils { public static final String join(final String... parts) { final StringBuilder sb = new StringBuilder(); for (final String part:parts) { Preconditions.checkNotNull(part, "parts cannot contain null"); if (!Strings.isNullOrEmpty(part)) { sb.append(part).append("/"); } } if (sb.length() > 0) { sb.deleteCharAt(sb... |
@Test public void testNormalizeRemovesRedundantForwardSlashes() { final String actual = PathUtils.normalize("/a/b/c"); final String expected = "/a/b/c"; Assert.assertEquals("invalid path", expected, actual); final String actual2 = PathUtils.normalize(" final String expected2 = "/a/b/c"; Assert.assertEquals("invalid pat... | public static final String normalize(final String path) { if (Strings.isNullOrEmpty(Preconditions.checkNotNull(path))) { return path; } final StringBuilder builder = new StringBuilder(); char last = path.charAt(0); builder.append(last); for (int i=1; i<path.length(); i++) { char cur = path.charAt(i); if (last == '/' &&... | PathUtils { public static final String normalize(final String path) { if (Strings.isNullOrEmpty(Preconditions.checkNotNull(path))) { return path; } final StringBuilder builder = new StringBuilder(); char last = path.charAt(0); builder.append(last); for (int i=1; i<path.length(); i++) { char cur = path.charAt(i); if (la... | PathUtils { public static final String normalize(final String path) { if (Strings.isNullOrEmpty(Preconditions.checkNotNull(path))) { return path; } final StringBuilder builder = new StringBuilder(); char last = path.charAt(0); builder.append(last); for (int i=1; i<path.length(); i++) { char cur = path.charAt(i); if (la... | PathUtils { public static final String normalize(final String path) { if (Strings.isNullOrEmpty(Preconditions.checkNotNull(path))) { return path; } final StringBuilder builder = new StringBuilder(); char last = path.charAt(0); builder.append(last); for (int i=1; i<path.length(); i++) { char cur = path.charAt(i); if (la... | PathUtils { public static final String normalize(final String path) { if (Strings.isNullOrEmpty(Preconditions.checkNotNull(path))) { return path; } final StringBuilder builder = new StringBuilder(); char last = path.charAt(0); builder.append(last); for (int i=1; i<path.length(); i++) { char cur = path.charAt(i); if (la... |
@Test public void testQueueProcessor() throws Exception { Pointer<Long> counter = new Pointer<>(0L); final ReentrantReadWriteLock rwlock = new ReentrantReadWriteLock(); Lock readLock = rwlock.readLock(); Lock writeLock = rwlock.writeLock(); QueueProcessor<Long> qp = new QueueProcessor<>("queue-processor", () -> new Aut... | public QueueProcessor(String name, Supplier<AutoCloseableLock> lockSupplier, Consumer<T> consumer) { this.name = name; this.lockSupplier = lockSupplier; this.consumer = consumer; this.queue = new LinkedBlockingQueue<>(); this.workerThread = null; this.isClosed = false; this.completed = true; } | QueueProcessor implements AutoCloseable { public QueueProcessor(String name, Supplier<AutoCloseableLock> lockSupplier, Consumer<T> consumer) { this.name = name; this.lockSupplier = lockSupplier; this.consumer = consumer; this.queue = new LinkedBlockingQueue<>(); this.workerThread = null; this.isClosed = false; this.com... | QueueProcessor implements AutoCloseable { public QueueProcessor(String name, Supplier<AutoCloseableLock> lockSupplier, Consumer<T> consumer) { this.name = name; this.lockSupplier = lockSupplier; this.consumer = consumer; this.queue = new LinkedBlockingQueue<>(); this.workerThread = null; this.isClosed = false; this.com... | QueueProcessor implements AutoCloseable { public QueueProcessor(String name, Supplier<AutoCloseableLock> lockSupplier, Consumer<T> consumer) { this.name = name; this.lockSupplier = lockSupplier; this.consumer = consumer; this.queue = new LinkedBlockingQueue<>(); this.workerThread = null; this.isClosed = false; this.com... | QueueProcessor implements AutoCloseable { public QueueProcessor(String name, Supplier<AutoCloseableLock> lockSupplier, Consumer<T> consumer) { this.name = name; this.lockSupplier = lockSupplier; this.consumer = consumer; this.queue = new LinkedBlockingQueue<>(); this.workerThread = null; this.isClosed = false; this.com... |
@Test public void testConfigureAndStart() throws IOException, InterruptedException, MalformedObjectNameException { final MetricRegistry metrics = new MetricRegistry(); metrics.counter(NAME, () -> { Counter counter = new Counter(); counter.inc(1234); return counter; }); final JmxConfigurator configurator = new JmxConfig... | @Override public void configureAndStart(String name, MetricRegistry registry, MetricFilter filter) { reporter = JmxReporter.forRegistry(registry).convertRatesTo(rateUnit).convertDurationsTo(durationUnit).filter(filter).build(); reporter.start(); } | JmxConfigurator extends ReporterConfigurator { @Override public void configureAndStart(String name, MetricRegistry registry, MetricFilter filter) { reporter = JmxReporter.forRegistry(registry).convertRatesTo(rateUnit).convertDurationsTo(durationUnit).filter(filter).build(); reporter.start(); } } | JmxConfigurator extends ReporterConfigurator { @Override public void configureAndStart(String name, MetricRegistry registry, MetricFilter filter) { reporter = JmxReporter.forRegistry(registry).convertRatesTo(rateUnit).convertDurationsTo(durationUnit).filter(filter).build(); reporter.start(); } @JsonCreator JmxConfigur... | JmxConfigurator extends ReporterConfigurator { @Override public void configureAndStart(String name, MetricRegistry registry, MetricFilter filter) { reporter = JmxReporter.forRegistry(registry).convertRatesTo(rateUnit).convertDurationsTo(durationUnit).filter(filter).build(); reporter.start(); } @JsonCreator JmxConfigur... | JmxConfigurator extends ReporterConfigurator { @Override public void configureAndStart(String name, MetricRegistry registry, MetricFilter filter) { reporter = JmxReporter.forRegistry(registry).convertRatesTo(rateUnit).convertDurationsTo(durationUnit).filter(filter).build(); reporter.start(); } @JsonCreator JmxConfigur... |
@Test public void close() throws Exception { final CloseableSchedulerThreadPool executorService = mock(CloseableSchedulerThreadPool.class); final LocalSchedulerService service = new LocalSchedulerService(executorService, null, null, false); service.close(); verify(executorService).close(); } | @Override public void close() throws Exception { LOGGER.info("Stopping SchedulerService"); AutoCloseables.close(AutoCloseables.iter(executorService), taskLeaderElectionServiceMap.values()); LOGGER.info("Stopped SchedulerService"); } | LocalSchedulerService implements SchedulerService { @Override public void close() throws Exception { LOGGER.info("Stopping SchedulerService"); AutoCloseables.close(AutoCloseables.iter(executorService), taskLeaderElectionServiceMap.values()); LOGGER.info("Stopped SchedulerService"); } } | LocalSchedulerService implements SchedulerService { @Override public void close() throws Exception { LOGGER.info("Stopping SchedulerService"); AutoCloseables.close(AutoCloseables.iter(executorService), taskLeaderElectionServiceMap.values()); LOGGER.info("Stopped SchedulerService"); } LocalSchedulerService(int corePoolS... | LocalSchedulerService implements SchedulerService { @Override public void close() throws Exception { LOGGER.info("Stopping SchedulerService"); AutoCloseables.close(AutoCloseables.iter(executorService), taskLeaderElectionServiceMap.values()); LOGGER.info("Stopped SchedulerService"); } LocalSchedulerService(int corePoolS... | LocalSchedulerService implements SchedulerService { @Override public void close() throws Exception { LOGGER.info("Stopping SchedulerService"); AutoCloseables.close(AutoCloseables.iter(executorService), taskLeaderElectionServiceMap.values()); LOGGER.info("Stopped SchedulerService"); } LocalSchedulerService(int corePoolS... |
@Test public void newThread() { LocalSchedulerService service = new LocalSchedulerService(1); final Runnable runnable = mock(Runnable.class); final Thread thread = service.getExecutorService().getThreadFactory().newThread(runnable); assertTrue("thread should be a daemon thread", thread.isDaemon()); assertTrue("thread n... | @VisibleForTesting public CloseableSchedulerThreadPool getExecutorService() { return executorService; } | LocalSchedulerService implements SchedulerService { @VisibleForTesting public CloseableSchedulerThreadPool getExecutorService() { return executorService; } } | LocalSchedulerService implements SchedulerService { @VisibleForTesting public CloseableSchedulerThreadPool getExecutorService() { return executorService; } LocalSchedulerService(int corePoolSize); LocalSchedulerService(int corePoolSize,
Provider<ClusterCoordinator> clusterCoordinatorProv... | LocalSchedulerService implements SchedulerService { @VisibleForTesting public CloseableSchedulerThreadPool getExecutorService() { return executorService; } LocalSchedulerService(int corePoolSize); LocalSchedulerService(int corePoolSize,
Provider<ClusterCoordinator> clusterCoordinatorProv... | LocalSchedulerService implements SchedulerService { @VisibleForTesting public CloseableSchedulerThreadPool getExecutorService() { return executorService; } LocalSchedulerService(int corePoolSize); LocalSchedulerService(int corePoolSize,
Provider<ClusterCoordinator> clusterCoordinatorProv... |
@Test public void schedule() throws Exception { final List<MockScheduledFuture<?>> futures = Lists.newArrayList(); final CloseableSchedulerThreadPool executorService = mock(CloseableSchedulerThreadPool.class); doAnswer(new Answer<ScheduledFuture<Object>>() { @Override public ScheduledFuture<Object> answer(InvocationOnM... | @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection = getTaskLeaderElection(schedule); CancellableTask ... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... |
@Test public void scheduleCancelledBeforeRun() throws Exception { final List<MockScheduledFuture<?>> futures = Lists.newArrayList(); final CloseableSchedulerThreadPool executorService = mock(CloseableSchedulerThreadPool.class); doAnswer(new Answer<ScheduledFuture<Object>>() { @Override public ScheduledFuture<Object> an... | @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection = getTaskLeaderElection(schedule); CancellableTask ... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... | LocalSchedulerService implements SchedulerService { @Override public Cancellable schedule(Schedule schedule, Runnable task) { if (!assumeTaskLeadership) { return plainSchedule(schedule, task); } if (!schedule.isDistributedSingleton()) { return plainSchedule(schedule, task); } final TaskLeaderElection taskLeaderElection... |
@Test public void onlyExclude() { IncludesExcludesFilter f = new IncludesExcludesFilter(Arrays.asList(), Arrays.asList("a.*")); assertFalse(f.matches("alpha", null)); assertTrue(f.matches("beta", null)); } | @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... |
@Test public void onlyInclude() { IncludesExcludesFilter f = new IncludesExcludesFilter(Arrays.asList("a.*"), Arrays.asList()); assertTrue(f.matches("alpha", null)); assertFalse(f.matches("beta", null)); } | @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... |
@Test public void testMutatorApplyDropNonPreview() { boolean preview = false; TransformResult result2 = mutator(preview).apply("foo", "foo2", newValue, true); assertEquals(newHashSet("foo2"), result2.getAddedColumns()); assertEquals(newHashSet(), result2.getModifiedColumns()); assertEquals(newHashSet("foo"), result2.ge... | public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... |
@Test public void includeAndExclude() { IncludesExcludesFilter f = new IncludesExcludesFilter(Arrays.asList("a.*"), Arrays.asList("a\\.b.*")); assertTrue(f.matches("a.alpha", null)); assertFalse(f.matches("a.beta", null)); } | @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... |
@Test public void noValues() { IncludesExcludesFilter f = new IncludesExcludesFilter(Arrays.asList(), Arrays.asList()); assertTrue(f.matches(null, null)); } | @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); } | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... | IncludesExcludesFilter implements MetricFilter { @Override public boolean matches(String name, Metric metric) { if (includes.isEmpty() || matches(name, includes)) { return allowedViaExcludes(name); } return false; } IncludesExcludesFilter(List<String> includes, List<String> excludes); @Override boolean matches(String n... |
@Test public void TestInterleavedMidToSmall() { LinkedList<String> l1 = GetRandomStringList(TOTAL_STRINGS, midAvgSize); LinkedList<String> l2 = GetRandomStringList(TOTAL_STRINGS, smallAvgSize); final double threshold = 1.0D; System.out.println("TestInterleavedMidToSmall: threshold: " + threshold + " (only forcecompact)... | @Override public void close() { this.clear(); } | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } } | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } MutableVarcharVector(String name, BufferAllocator allocator, double compactionThreshold); MutableVarcharVector(String name, FieldType fieldType, BufferAllocator allocator, double compactionThreshold); } | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } MutableVarcharVector(String name, BufferAllocator allocator, double compactionThreshold); MutableVarcharVector(String name, FieldType fieldType, BufferAllocator allocator, double compactionThreshold); final void setC... | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } MutableVarcharVector(String name, BufferAllocator allocator, double compactionThreshold); MutableVarcharVector(String name, FieldType fieldType, BufferAllocator allocator, double compactionThreshold); final void setC... |
@Test public void TestInterleavedSmallToMid() { LinkedList<String> l1 = GetRandomStringList(TOTAL_STRINGS, smallAvgSize); LinkedList<String> l2 = GetRandomStringList(TOTAL_STRINGS, midAvgSize); final double threshold = 1.0D; System.out.println("TestInterleavedSmallToMid: threshold: " + threshold + " (only forcecompact)... | @Override public void close() { this.clear(); } | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } } | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } MutableVarcharVector(String name, BufferAllocator allocator, double compactionThreshold); MutableVarcharVector(String name, FieldType fieldType, BufferAllocator allocator, double compactionThreshold); } | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } MutableVarcharVector(String name, BufferAllocator allocator, double compactionThreshold); MutableVarcharVector(String name, FieldType fieldType, BufferAllocator allocator, double compactionThreshold); final void setC... | MutableVarcharVector extends BaseVariableWidthVector { @Override public void close() { this.clear(); } MutableVarcharVector(String name, BufferAllocator allocator, double compactionThreshold); MutableVarcharVector(String name, FieldType fieldType, BufferAllocator allocator, double compactionThreshold); final void setC... |
@Test public void testHandlePassesNoopTracesByDefault() throws RpcException { setup(false); server.handle(connection, GET_CATALOGS_VALUE, pBody, dBody, responseSender); verify(ingestor).feedWork(eq(connection), eq(GET_CATALOGS_VALUE), eq(pBody), eq(dBody), captorSender.capture()); assertEquals(tracer.finishedSpans().si... | @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender"); } | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... |
@Test public void testHandleCreatesSpansFromTracerWhenTracingEnabled() throws RpcException { setup(true); server.handle(connection, GET_SCHEMAS_VALUE, pBody, dBody, responseSender); verify(ingestor).feedWork(eq(connection), eq(GET_SCHEMAS_VALUE), eq(pBody), eq(dBody), captorSender.capture()); assertEquals(tracer.finish... | @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender"); } | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... |
@Test public void testHandleSpansWhileSendingFailure() throws RpcException { setup(true); server.handle(connection, GET_CATALOGS_VALUE, pBody, dBody, responseSender); verify(ingestor).feedWork(eq(connection), eq(GET_CATALOGS_VALUE), eq(pBody), eq(dBody), captorSender.capture()); assertEquals(tracer.finishedSpans().size... | @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender"); } | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... |
@Test public void testHandleFinishesSpanIfFeedFailure() throws RpcException { WorkIngestor ingest = (con, rpc, pb, db, sender) -> { throw new RpcException(); }; setup(ingest, true); try { server.handle(connection, CANCEL_QUERY_VALUE, pBody, dBody, responseSender); } catch (RpcException e) { } assertEquals(1, tracer.fin... | @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender"); } | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... | UserRPCServer extends BasicServer<RpcType, UserRPCServer.UserClientConnectionImpl> { @Override protected Response handle(UserClientConnectionImpl connection, int rpcType, byte[] pBody, ByteBuf dBody) throws RpcException { throw new IllegalStateException("UserRPCServer#handle must not be invoked without ResponseSender")... |
@Test public void testQueriesClerk() throws Exception{ WorkloadTicketDepot ticketDepot = new WorkloadTicketDepot(mockedRootAlloc, mock(SabotConfig.class), DUMMY_GROUP_MANAGER); QueriesClerk clerk = makeClerk(ticketDepot); assertLivePhasesCount(clerk, 0); int baseNumAllocators = getNumAllocators(); UserBitShared.QueryId... | QueriesClerk(final WorkloadTicketDepot workloadTicketDepot) { this.workloadTicketDepot = workloadTicketDepot; } | QueriesClerk { QueriesClerk(final WorkloadTicketDepot workloadTicketDepot) { this.workloadTicketDepot = workloadTicketDepot; } } | QueriesClerk { QueriesClerk(final WorkloadTicketDepot workloadTicketDepot) { this.workloadTicketDepot = workloadTicketDepot; } QueriesClerk(final WorkloadTicketDepot workloadTicketDepot); } | QueriesClerk { QueriesClerk(final WorkloadTicketDepot workloadTicketDepot) { this.workloadTicketDepot = workloadTicketDepot; } QueriesClerk(final WorkloadTicketDepot workloadTicketDepot); void buildAndStartQuery(final PlanFragmentFull firstFragment, final SchedulingInfo schedulingInfo,
... | QueriesClerk { QueriesClerk(final WorkloadTicketDepot workloadTicketDepot) { this.workloadTicketDepot = workloadTicketDepot; } QueriesClerk(final WorkloadTicketDepot workloadTicketDepot); void buildAndStartQuery(final PlanFragmentFull firstFragment, final SchedulingInfo schedulingInfo,
... |
@Test public void testGetFragmentTickets() throws Exception { WorkloadTicketDepot ticketDepot = new WorkloadTicketDepot(mockedRootAlloc, mock(SabotConfig.class), DUMMY_GROUP_MANAGER); QueriesClerk clerk = makeClerk(ticketDepot); UserBitShared.QueryId queryId = UserBitShared.QueryId.newBuilder().setPart1(12).setPart2(23... | Collection<FragmentTicket> getFragmentTickets(QueryId queryId) { List<FragmentTicket> fragmentTickets = new ArrayList<>(); for (WorkloadTicket workloadTicket : getWorkloadTickets()) { QueryTicket queryTicket = workloadTicket.getQueryTicket(queryId); if (queryTicket != null) { for (PhaseTicket phaseTicket : queryTicket.... | QueriesClerk { Collection<FragmentTicket> getFragmentTickets(QueryId queryId) { List<FragmentTicket> fragmentTickets = new ArrayList<>(); for (WorkloadTicket workloadTicket : getWorkloadTickets()) { QueryTicket queryTicket = workloadTicket.getQueryTicket(queryId); if (queryTicket != null) { for (PhaseTicket phaseTicket... | QueriesClerk { Collection<FragmentTicket> getFragmentTickets(QueryId queryId) { List<FragmentTicket> fragmentTickets = new ArrayList<>(); for (WorkloadTicket workloadTicket : getWorkloadTickets()) { QueryTicket queryTicket = workloadTicket.getQueryTicket(queryId); if (queryTicket != null) { for (PhaseTicket phaseTicket... | QueriesClerk { Collection<FragmentTicket> getFragmentTickets(QueryId queryId) { List<FragmentTicket> fragmentTickets = new ArrayList<>(); for (WorkloadTicket workloadTicket : getWorkloadTickets()) { QueryTicket queryTicket = workloadTicket.getQueryTicket(queryId); if (queryTicket != null) { for (PhaseTicket phaseTicket... | QueriesClerk { Collection<FragmentTicket> getFragmentTickets(QueryId queryId) { List<FragmentTicket> fragmentTickets = new ArrayList<>(); for (WorkloadTicket workloadTicket : getWorkloadTickets()) { QueryTicket queryTicket = workloadTicket.getQueryTicket(queryId); if (queryTicket != null) { for (PhaseTicket phaseTicket... |
@Test public void testMutatorApplyNoDropPreview() { boolean preview = true; TransformResult result = mutator(preview).apply("foo", "foo2", newValue, false); assertEquals(newHashSet("foo2"), result.getAddedColumns()); assertEquals(newHashSet(), result.getModifiedColumns()); assertEquals(newHashSet(), result.getRemovedCo... | public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... |
@Test public void testTasksWithoutUUID() throws Exception { DACConfig dacConfig = DACConfig.newConfig(); Upgrade upgrade = new Upgrade(dacConfig, CLASSPATH_SCAN_RESULT, false); List<? extends UpgradeTask> tasks = upgrade.getUpgradeTasks(); tasks.forEach(task -> assertNotNull( String.format( "Need to add UUID to task: '... | @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } } | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } Upgrade(DACConfig dacConfig, ScanResult classPathScan, boolean verbose); } | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } Upgrade(DACConfig dacConfig, ScanResult classPathScan, boolean verbose); void run(); void run(boolean noDBOpenRetry); @VisibleForTesting void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdi... | Upgrade { @VisibleForTesting List<? extends UpgradeTask> getUpgradeTasks() { return upgradeTasks; } Upgrade(DACConfig dacConfig, ScanResult classPathScan, boolean verbose); void run(); void run(boolean noDBOpenRetry); @VisibleForTesting void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdi... |
@Test public void testOldThreadsArePruned() throws InterruptedException { Thread t = new Thread() { public void run () { try { sleep(400l); } catch (InterruptedException e) { } } }; Thread t1 = new Thread() { public void run () { try { sleep(400l); } catch (InterruptedException e) { } } }; t.start(); t1.start(); Thread... | public Integer getCpuTrailingAverage(long id, int seconds) { return cpuStat.getTrailingAverage(id, seconds); } | ThreadsStatsCollector extends Thread implements AutoCloseable { public Integer getCpuTrailingAverage(long id, int seconds) { return cpuStat.getTrailingAverage(id, seconds); } } | ThreadsStatsCollector extends Thread implements AutoCloseable { public Integer getCpuTrailingAverage(long id, int seconds) { return cpuStat.getTrailingAverage(id, seconds); } ThreadsStatsCollector(Set<Long> slicingThreadIds); ThreadsStatsCollector(long collectionIntervalInMilliSeconds, Set<Long> slicingThreadIds); } | ThreadsStatsCollector extends Thread implements AutoCloseable { public Integer getCpuTrailingAverage(long id, int seconds) { return cpuStat.getTrailingAverage(id, seconds); } ThreadsStatsCollector(Set<Long> slicingThreadIds); ThreadsStatsCollector(long collectionIntervalInMilliSeconds, Set<Long> slicingThreadIds); @Ov... | ThreadsStatsCollector extends Thread implements AutoCloseable { public Integer getCpuTrailingAverage(long id, int seconds) { return cpuStat.getTrailingAverage(id, seconds); } ThreadsStatsCollector(Set<Long> slicingThreadIds); ThreadsStatsCollector(long collectionIntervalInMilliSeconds, Set<Long> slicingThreadIds); @Ov... |
@Test public void testSendRuntimeFilterToProbeScan() { int probeScanId = 2; int probeOpId = 131074; int buildMajorFragment = 1; int buildMinorFragment = 2; int buildOpId = 65541; QueryId queryId = QueryId.newBuilder().build(); try (ArrowBuf recvBuffer = bfTestAllocator.buffer(64)) { recvBuffer.setBytes(0, new byte[64])... | @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(), partitionColFilter); logger.debug("Partition col filter... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... |
@Test public void testSendRuntimeFilterToProbeScanMajorFragmentNotPresent() { int probeScanId = 2; int differentProbeScanId = 5; int probeOpId = 131074; int buildMajorFragment = 1; int buildMinorFragment = 2; int buildOpId = 65541; QueryId queryId = QueryId.newBuilder().build(); ArrowBuf recvBuffer = bfTestAllocator.bu... | @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(), partitionColFilter); logger.debug("Partition col filter... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... | VectorizedHashJoinOperator implements DualInputOperator { @VisibleForTesting void sendRuntimeFilterToProbeScan(RuntimeFilter filter, Optional<BloomFilter> partitionColFilter) { logger.debug("Sending join runtime filter to probe scan {}:{}, Filter {}", filter.getProbeScanOperatorId(), filter.getProbeScanMajorFragmentId(... |
@Test public void randomBits() throws Exception { final int count = 8*1024*1024; BitSet bitSet = new BitSet(count); final Random rand = new Random(); try (MatchBitSet matchBitSet = new MatchBitSet(count, allocator)) { for (int i = 0; i < count; i ++) { int val = rand.nextInt(10); if (val > 3) { bitSet.set(i); matchBitS... | public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(wordAddr) | bitMask); } | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... |
@Test public void fullBits() throws Exception { final int count = 256*1024; BitSet bitSet = new BitSet(count); try (MatchBitSet matchBitSet = new MatchBitSet(count, allocator)) { for (int i = 0; i < count; i++) { bitSet.set(i); matchBitSet.set(i); } validateBits(matchBitSet, bitSet, count); } } | public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(wordAddr) | bitMask); } | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... |
@Test public void specifiedBits() throws Exception { final int count = 256*1024 + 13; BitSet bitSet = new BitSet(count); try (MatchBitSet matchBitSet = new MatchBitSet(count, allocator)) { for (int i = 0; i < count; i += WORD_BITS) { if ((i / WORD_BITS) % 3 == 0) { for (int j = 0; j < WORD_BITS; j++) { bitSet.set(i + j... | public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(wordAddr) | bitMask); } | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... | MatchBitSet implements AutoCloseable { public void set(final int index) { final int wordNum = index >>> LONG_TO_BITS_SHIFT; final int bit = index & BIT_OFFSET_MUSK; final long bitMask = 1L << bit; final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD; PlatformDependent.putLong(wordAddr, PlatformDependent.getLong(... |
@Test public void testPrepareBloomFilter() throws Exception { List<AutoCloseable> closeables = new ArrayList<>(); try (ArrowBuf keyBuf = testAllocator.buffer(9); LBlockHashTableEight table = new LBlockHashTableEight(HashConfig.getDefault(), testAllocator, 16)) { Set<Long> dataSet = generatedData(10); dataSet.stream().f... | public Optional<BloomFilter> prepareBloomFilter(final boolean sizeDynamically) throws Exception { final long bloomFilterSize = sizeDynamically ? Math.min(BloomFilter.getOptimalSize(size()), BLOOMFILTER_MAX_SIZE) : BLOOMFILTER_MAX_SIZE; try (ArrowBuf keyHolder = allocator.buffer(9); RollbackCloseable closeOnErr = new Ro... | LBlockHashTableEight implements AutoCloseable { public Optional<BloomFilter> prepareBloomFilter(final boolean sizeDynamically) throws Exception { final long bloomFilterSize = sizeDynamically ? Math.min(BloomFilter.getOptimalSize(size()), BLOOMFILTER_MAX_SIZE) : BLOOMFILTER_MAX_SIZE; try (ArrowBuf keyHolder = allocator.... | LBlockHashTableEight implements AutoCloseable { public Optional<BloomFilter> prepareBloomFilter(final boolean sizeDynamically) throws Exception { final long bloomFilterSize = sizeDynamically ? Math.min(BloomFilter.getOptimalSize(size()), BLOOMFILTER_MAX_SIZE) : BLOOMFILTER_MAX_SIZE; try (ArrowBuf keyHolder = allocator.... | LBlockHashTableEight implements AutoCloseable { public Optional<BloomFilter> prepareBloomFilter(final boolean sizeDynamically) throws Exception { final long bloomFilterSize = sizeDynamically ? Math.min(BloomFilter.getOptimalSize(size()), BLOOMFILTER_MAX_SIZE) : BLOOMFILTER_MAX_SIZE; try (ArrowBuf keyHolder = allocator.... | LBlockHashTableEight implements AutoCloseable { public Optional<BloomFilter> prepareBloomFilter(final boolean sizeDynamically) throws Exception { final long bloomFilterSize = sizeDynamically ? Math.min(BloomFilter.getOptimalSize(size()), BLOOMFILTER_MAX_SIZE) : BLOOMFILTER_MAX_SIZE; try (ArrowBuf keyHolder = allocator.... |
@Test public void testReserveMemory() { SharedResourceGroup resourceGroup = mock(SharedResourceGroup.class); SabotConfig config = mock(SabotConfig.class); FragmentWorkQueue workQueue = mock(FragmentWorkQueue.class); TunnelProvider tunnelProvider = mock(TunnelProvider.class); EndpointsIndex endpointsIndex = new Endpoint... | @Override public synchronized void close() throws Exception { if(!closed){ final List<AutoCloseable> closeables = new ArrayList<>(); closeables.addAll(Arrays.asList(buffers)); closeables.add(new AutoCloseable() { @Override public void close() throws Exception { for (int i = 0; i < completionMessages.length; i++) { comp... | AbstractDataCollector implements DataCollector { @Override public synchronized void close() throws Exception { if(!closed){ final List<AutoCloseable> closeables = new ArrayList<>(); closeables.addAll(Arrays.asList(buffers)); closeables.add(new AutoCloseable() { @Override public void close() throws Exception { for (int ... | AbstractDataCollector implements DataCollector { @Override public synchronized void close() throws Exception { if(!closed){ final List<AutoCloseable> closeables = new ArrayList<>(); closeables.addAll(Arrays.asList(buffers)); closeables.add(new AutoCloseable() { @Override public void close() throws Exception { for (int ... | AbstractDataCollector implements DataCollector { @Override public synchronized void close() throws Exception { if(!closed){ final List<AutoCloseable> closeables = new ArrayList<>(); closeables.addAll(Arrays.asList(buffers)); closeables.add(new AutoCloseable() { @Override public void close() throws Exception { for (int ... | AbstractDataCollector implements DataCollector { @Override public synchronized void close() throws Exception { if(!closed){ final List<AutoCloseable> closeables = new ArrayList<>(); closeables.addAll(Arrays.asList(buffers)); closeables.add(new AutoCloseable() { @Override public void close() throws Exception { for (int ... |
@Test public void pivotDef(){ try( IntVector col1 = new IntVector("col1", allocator); IntVector col2 = new IntVector("col2", allocator); BigIntVector col3 = new BigIntVector("col3", allocator); TimeMilliVector col4 = new TimeMilliVector("col4", allocator); VarCharVector col5 = new VarCharVector("col5", allocator); VarC... | public PivotDef( int blockWidth, int variableCount, int bitCount, List<VectorPivotDef> fields) { super(); this.blockWidth = blockWidth; this.variableCount = variableCount; this.bitCount = bitCount; this.vectorPivots = ImmutableList.copyOf(fields); this.fixedPivots = FluentIterable.from(vectorPivots).filter(new Predicat... | PivotDef { public PivotDef( int blockWidth, int variableCount, int bitCount, List<VectorPivotDef> fields) { super(); this.blockWidth = blockWidth; this.variableCount = variableCount; this.bitCount = bitCount; this.vectorPivots = ImmutableList.copyOf(fields); this.fixedPivots = FluentIterable.from(vectorPivots).filter(n... | PivotDef { public PivotDef( int blockWidth, int variableCount, int bitCount, List<VectorPivotDef> fields) { super(); this.blockWidth = blockWidth; this.variableCount = variableCount; this.bitCount = bitCount; this.vectorPivots = ImmutableList.copyOf(fields); this.fixedPivots = FluentIterable.from(vectorPivots).filter(n... | PivotDef { public PivotDef( int blockWidth, int variableCount, int bitCount, List<VectorPivotDef> fields) { super(); this.blockWidth = blockWidth; this.variableCount = variableCount; this.bitCount = bitCount; this.vectorPivots = ImmutableList.copyOf(fields); this.fixedPivots = FluentIterable.from(vectorPivots).filter(n... | PivotDef { public PivotDef( int blockWidth, int variableCount, int bitCount, List<VectorPivotDef> fields) { super(); this.blockWidth = blockWidth; this.variableCount = variableCount; this.bitCount = bitCount; this.vectorPivots = ImmutableList.copyOf(fields); this.fixedPivots = FluentIterable.from(vectorPivots).filter(n... |
@Test public void boolNullEveryOther() throws Exception { final int count = 1024; try ( BitVector in = new BitVector("in", allocator); BitVector out = new BitVector("out", allocator); ) { in.allocateNew(count); ArrowBuf tempBuf = allocator.buffer(1024); for (int i = 0; i < count; i ++) { if (i % 2 == 0) { in.set(i, 1);... | public static int pivot(PivotDef pivot, int start, int count, FixedBlockVector fixedBlock, VariableBlockVector variable) { if (pivot.getVariableCount() > 0) { int updatedCount = pivotVariableLengths(pivot.getVariablePivots(), fixedBlock, variable, start, count); Preconditions.checkState(updatedCount <= count); count = ... | BoundedPivots { public static int pivot(PivotDef pivot, int start, int count, FixedBlockVector fixedBlock, VariableBlockVector variable) { if (pivot.getVariableCount() > 0) { int updatedCount = pivotVariableLengths(pivot.getVariablePivots(), fixedBlock, variable, start, count); Preconditions.checkState(updatedCount <= ... | BoundedPivots { public static int pivot(PivotDef pivot, int start, int count, FixedBlockVector fixedBlock, VariableBlockVector variable) { if (pivot.getVariableCount() > 0) { int updatedCount = pivotVariableLengths(pivot.getVariablePivots(), fixedBlock, variable, start, count); Preconditions.checkState(updatedCount <= ... | BoundedPivots { public static int pivot(PivotDef pivot, int start, int count, FixedBlockVector fixedBlock, VariableBlockVector variable) { if (pivot.getVariableCount() > 0) { int updatedCount = pivotVariableLengths(pivot.getVariablePivots(), fixedBlock, variable, start, count); Preconditions.checkState(updatedCount <= ... | BoundedPivots { public static int pivot(PivotDef pivot, int start, int count, FixedBlockVector fixedBlock, VariableBlockVector variable) { if (pivot.getVariableCount() > 0) { int updatedCount = pivotVariableLengths(pivot.getVariablePivots(), fixedBlock, variable, start, count); Preconditions.checkState(updatedCount <= ... |
@Test public void testMutatorApplyReplacePreview() { boolean preview = true; TransformResult result1 = mutator(preview).apply("foo", "foo", newValue, true); assertEquals(newHashSet("foo (new)"), result1.getAddedColumns()); assertEquals(newHashSet(), result1.getModifiedColumns()); assertEquals(newHashSet("foo"), result1... | public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... |
@Test public void testWorkOnOOBRuntimeFilterInvalidFilterSize() { int buildMinorFragment1 = 2; int buildMajorFragment1 = 1; try (ArrowBuf oobMessageBuf = testAllocator.buffer(128)) { RuntimeFilter filter1 = newRuntimeFilter(32, "col1", "col2"); OutOfBandMessage msg1 = newOOBMessage(filter1, oobMessageBuf, buildMajorFra... | @Override public void workOnOOB(OutOfBandMessage message) { final ArrowBuf msgBuf = message.getBuffer(); final String senderInfo = String.format("Frag %d:%d, OpId %d", message.getSendingMajorFragmentId(), message.getSendingMinorFragmentId(), message.getSendingOperatorId()); if (msgBuf==null || msgBuf.capacity()==0) { l... | ScanOperator implements ProducerOperator { @Override public void workOnOOB(OutOfBandMessage message) { final ArrowBuf msgBuf = message.getBuffer(); final String senderInfo = String.format("Frag %d:%d, OpId %d", message.getSendingMajorFragmentId(), message.getSendingMinorFragmentId(), message.getSendingOperatorId()); if... | ScanOperator implements ProducerOperator { @Override public void workOnOOB(OutOfBandMessage message) { final ArrowBuf msgBuf = message.getBuffer(); final String senderInfo = String.format("Frag %d:%d, OpId %d", message.getSendingMajorFragmentId(), message.getSendingMinorFragmentId(), message.getSendingOperatorId()); if... | ScanOperator implements ProducerOperator { @Override public void workOnOOB(OutOfBandMessage message) { final ArrowBuf msgBuf = message.getBuffer(); final String senderInfo = String.format("Frag %d:%d, OpId %d", message.getSendingMajorFragmentId(), message.getSendingMinorFragmentId(), message.getSendingOperatorId()); if... | ScanOperator implements ProducerOperator { @Override public void workOnOOB(OutOfBandMessage message) { final ArrowBuf msgBuf = message.getBuffer(); final String senderInfo = String.format("Frag %d:%d, OpId %d", message.getSendingMajorFragmentId(), message.getSendingMinorFragmentId(), message.getSendingOperatorId()); if... |
@Test public void testIgnoreOtherMessages() throws Exception { RpcCompatibilityEncoder encoder = new RpcCompatibilityEncoder(); ChannelHandlerContext context = mock(ChannelHandlerContext.class); OutboundRpcMessage message = new OutboundRpcMessage(RpcMode.PING, 0, 0, Acks.OK); List<Object> out = new ArrayList<>(); encod... | @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBody; if (!(pBody instanceof DremioPBError)) { out.add(message); return; } Dremio... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... |
@Test public void testIgnoreNonDremioPBErrorMessage() throws Exception { RpcCompatibilityEncoder encoder = new RpcCompatibilityEncoder(); ChannelHandlerContext context = mock(ChannelHandlerContext.class); OutboundRpcMessage message = new OutboundRpcMessage(RpcMode.RESPONSE_FAILURE, 0, 0, Acks.OK); List<Object> out = ne... | @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBody; if (!(pBody instanceof DremioPBError)) { out.add(message); return; } Dremio... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... |
@Test public void testUpdateErrorType() throws Exception { RpcCompatibilityEncoder encoder = new RpcCompatibilityEncoder(); ChannelHandlerContext context = mock(ChannelHandlerContext.class); DremioPBError error = DremioPBError.newBuilder() .setErrorType(ErrorType.IO_EXCEPTION) .setMessage("test message") .build(); Outb... | @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBody; if (!(pBody instanceof DremioPBError)) { out.add(message); return; } Dremio... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... | RpcCompatibilityEncoder extends MessageToMessageEncoder<OutboundRpcMessage> { @Override protected void encode(ChannelHandlerContext context, OutboundRpcMessage message, List<Object> out) throws Exception { if (message.mode != RpcMode.RESPONSE_FAILURE) { out.add(message); return; } final MessageLite pBody = message.pBod... |
@Test public void testEmptyFragmentList() { InOrder inOrder = Mockito.inOrder(completionListener, queryCloser); FragmentTracker fragmentTracker = new FragmentTracker(queryId, completionListener, queryCloser, null, new LocalExecutorSetService(DirectProvider.wrap(coordinator), DirectProvider.wrap(optionManager))); fragme... | public void populate(List<PlanFragmentFull> fragments, ResourceSchedulingDecisionInfo decisionInfo) { for (PlanFragmentFull fragment : fragments) { final NodeEndpoint assignment = fragment.getMinor().getAssignment(); pendingNodes.add(assignment); } executorSet = executorSetService.getExecutorSet(decisionInfo.getEngineI... | FragmentTracker implements AutoCloseable { public void populate(List<PlanFragmentFull> fragments, ResourceSchedulingDecisionInfo decisionInfo) { for (PlanFragmentFull fragment : fragments) { final NodeEndpoint assignment = fragment.getMinor().getAssignment(); pendingNodes.add(assignment); } executorSet = executorSetSer... | FragmentTracker implements AutoCloseable { public void populate(List<PlanFragmentFull> fragments, ResourceSchedulingDecisionInfo decisionInfo) { for (PlanFragmentFull fragment : fragments) { final NodeEndpoint assignment = fragment.getMinor().getAssignment(); pendingNodes.add(assignment); } executorSet = executorSetSer... | FragmentTracker implements AutoCloseable { public void populate(List<PlanFragmentFull> fragments, ResourceSchedulingDecisionInfo decisionInfo) { for (PlanFragmentFull fragment : fragments) { final NodeEndpoint assignment = fragment.getMinor().getAssignment(); pendingNodes.add(assignment); } executorSet = executorSetSer... | FragmentTracker implements AutoCloseable { public void populate(List<PlanFragmentFull> fragments, ResourceSchedulingDecisionInfo decisionInfo) { for (PlanFragmentFull fragment : fragments) { final NodeEndpoint assignment = fragment.getMinor().getAssignment(); pendingNodes.add(assignment); } executorSet = executorSetSer... |
@Test public void testUnsupportedRexNode() { try { RelDataTypeFactory relFactory = SqlTypeFactoryImpl.INSTANCE; RexBuilder rex = new DremioRexBuilder(relFactory); RelDataType anyType = relFactory.createSqlType(SqlTypeName.ANY); List<RexNode> emptyList = new LinkedList<>(); ImmutableList<RexFieldCollation> e = Immutable... | public static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr) { return toExpr(context, rowType, rexBuilder, expr, true); } | RexToExpr { public static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr) { return toExpr(context, rowType, rexBuilder, expr, true); } } | RexToExpr { public static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr) { return toExpr(context, rowType, rexBuilder, expr, true); } } | RexToExpr { public static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr) { return toExpr(context, rowType, rexBuilder, expr, true); } static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr); static Logical... | RexToExpr { public static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr) { return toExpr(context, rowType, rexBuilder, expr, true); } static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr); static Logical... |
@Test public void testNodesSorting() throws Exception { List<CoordinationProtos.NodeEndpoint> activeEndpoints = ImmutableList.of(N2_EP1, N3_EP1, N4_EP2); EndpointAffinity N1_EP1A = new EndpointAffinity(N1_EP1, 0.5); EndpointAffinity N1_EP2A = new EndpointAffinity(N1_EP2, 0.5); EndpointAffinity N2_EP1A = new EndpointAff... | @VisibleForTesting List<NodeEndpoint> findEndpoints(final Collection<NodeEndpoint> activeEndpoints, final Map<NodeEndpoint, EndpointAffinity> endpointAffinityMap, final int width, final ParallelizationParameters parameters) throws PhysicalOperatorSetupException { List<EndpointAffinity> sortedAffinityList; Set<NodeEndpo... | SoftAffinityFragmentParallelizer implements FragmentParallelizer { @VisibleForTesting List<NodeEndpoint> findEndpoints(final Collection<NodeEndpoint> activeEndpoints, final Map<NodeEndpoint, EndpointAffinity> endpointAffinityMap, final int width, final ParallelizationParameters parameters) throws PhysicalOperatorSetupE... | SoftAffinityFragmentParallelizer implements FragmentParallelizer { @VisibleForTesting List<NodeEndpoint> findEndpoints(final Collection<NodeEndpoint> activeEndpoints, final Map<NodeEndpoint, EndpointAffinity> endpointAffinityMap, final int width, final ParallelizationParameters parameters) throws PhysicalOperatorSetupE... | SoftAffinityFragmentParallelizer implements FragmentParallelizer { @VisibleForTesting List<NodeEndpoint> findEndpoints(final Collection<NodeEndpoint> activeEndpoints, final Map<NodeEndpoint, EndpointAffinity> endpointAffinityMap, final int width, final ParallelizationParameters parameters) throws PhysicalOperatorSetupE... | SoftAffinityFragmentParallelizer implements FragmentParallelizer { @VisibleForTesting List<NodeEndpoint> findEndpoints(final Collection<NodeEndpoint> activeEndpoints, final Map<NodeEndpoint, EndpointAffinity> endpointAffinityMap, final int width, final ParallelizationParameters parameters) throws PhysicalOperatorSetupE... |
@Test public void indexEndpointSingle() { EndpointsIndex.Builder indexBuilder = new EndpointsIndex.Builder(); NodeEndpoint ep = NodeEndpoint.newBuilder() .setAddress("localhost") .setFabricPort(1700) .build(); MinorFragmentEndpoint expected = new MinorFragmentEndpoint(16, ep); MinorFragmentIndexEndpoint indexEndpoint =... | public MinorFragmentEndpoint getFragmentEndpoint(MinorFragmentIndexEndpoint ep) { return fragmentsEndpointMap.computeIfAbsent(ep, k -> new MinorFragmentEndpoint(k.getMinorFragmentId(), endpoints.get(k.getEndpointIndex()))); } | EndpointsIndex { public MinorFragmentEndpoint getFragmentEndpoint(MinorFragmentIndexEndpoint ep) { return fragmentsEndpointMap.computeIfAbsent(ep, k -> new MinorFragmentEndpoint(k.getMinorFragmentId(), endpoints.get(k.getEndpointIndex()))); } } | EndpointsIndex { public MinorFragmentEndpoint getFragmentEndpoint(MinorFragmentIndexEndpoint ep) { return fragmentsEndpointMap.computeIfAbsent(ep, k -> new MinorFragmentEndpoint(k.getMinorFragmentId(), endpoints.get(k.getEndpointIndex()))); } EndpointsIndex(List<NodeEndpoint> endpoints); EndpointsIndex(); } | EndpointsIndex { public MinorFragmentEndpoint getFragmentEndpoint(MinorFragmentIndexEndpoint ep) { return fragmentsEndpointMap.computeIfAbsent(ep, k -> new MinorFragmentEndpoint(k.getMinorFragmentId(), endpoints.get(k.getEndpointIndex()))); } EndpointsIndex(List<NodeEndpoint> endpoints); EndpointsIndex(); NodeEndpoint... | EndpointsIndex { public MinorFragmentEndpoint getFragmentEndpoint(MinorFragmentIndexEndpoint ep) { return fragmentsEndpointMap.computeIfAbsent(ep, k -> new MinorFragmentEndpoint(k.getMinorFragmentId(), endpoints.get(k.getEndpointIndex()))); } EndpointsIndex(List<NodeEndpoint> endpoints); EndpointsIndex(); NodeEndpoint... |
@Test public void simpleCase1() throws Exception { final Wrapper wrapper = newWrapper(200, 1, 20, Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, 50))); INSTANCE.parallelizeFragment(wrapper, newParameters(SLICE_TARGET_DEFAULT, 5, 20), null); assertEquals(1, wrapper.getWidth()); final List<NodeEndpoint... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void matchHardAffinity() throws Exception { final Wrapper wrapper = newSplitWrapper(200, 1, 20, Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, 20)), new ExecutionNodeMap(ImmutableList.of(N1_EP1)) ); INSTANCE.parallelizeFragment(wrapper, newParameters(SLICE_TARGET_DEFAULT, 5, 20), null); ... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void testMutatorApplyDropPreview() { boolean preview = true; TransformResult result2 = mutator(preview).apply("foo", "foo2", newValue, true); assertEquals(newHashSet("foo2"), result2.getAddedColumns()); assertEquals(newHashSet(), result2.getModifiedColumns()); assertEquals(newHashSet("foo"), result2.getRem... | public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); } | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... | DatasetStateMutator { public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) { return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn); } DatasetStateMutator(String username, VirtualDatasetState virtualDatasetState, boolean preview); void setSql(QueryMetadata m... |
@Test public void noMatchHardAffinity() throws Exception { try { final Wrapper wrapper = newSplitWrapper(200, 1, 20, Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, 20)), new ExecutionNodeMap(ImmutableList.of(N2_EP1)) ); INSTANCE.parallelizeFragment(wrapper, newParameters(SLICE_TARGET_DEFAULT, 5, 20),... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void simpleCase2() throws Exception { final Wrapper wrapper = newWrapper(200, 1, 20, Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, 50))); INSTANCE.parallelizeFragment(wrapper, newParameters(1, 5, 20), null); assertEquals(5, wrapper.getWidth()); final List<NodeEndpoint> assignedEps = wra... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void multiNodeCluster1() throws Exception { final Wrapper wrapper = newWrapper(200, 1, 20, ImmutableList.of( new EndpointAffinity(N1_EP1, 0.15, true, 50), new EndpointAffinity(N1_EP2, 0.15, true, 50), new EndpointAffinity(N2_EP1, 0.10, true, 50), new EndpointAffinity(N3_EP2, 0.20, true, 50), new EndpointAf... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void multiNodeCluster2() throws Exception { final Wrapper wrapper = newWrapper(200, 1, 20, ImmutableList.of( new EndpointAffinity(N1_EP2, 0.15, true, 50), new EndpointAffinity(N2_EP2, 0.15, true, 50), new EndpointAffinity(N3_EP1, 0.10, true, 50), new EndpointAffinity(N4_EP2, 0.20, true, 50), new EndpointAf... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void multiNodeClusterNonNormalizedAffinities() throws Exception { final Wrapper wrapper = newWrapper(2000, 1, 250, ImmutableList.of( new EndpointAffinity(N1_EP2, 15, true, 50), new EndpointAffinity(N2_EP2, 15, true, 50), new EndpointAffinity(N3_EP1, 10, true, 50), new EndpointAffinity(N4_EP2, 20, true, 50)... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void multiNodeClusterNegative2() throws Exception { final Wrapper wrapper = newWrapper(200, 1, 3, ImmutableList.of( new EndpointAffinity(N1_EP2, 0.15, true, 50), new EndpointAffinity(N2_EP2, 0.15, true, 50), new EndpointAffinity(N3_EP1, 0.10, true, 50), new EndpointAffinity(N4_EP2, 0.20, true, 50), new End... | @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); final ParallelizationInfo pInfo = stats.getParallelizationInfo(); i... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... | HardAffinityFragmentParallelizer implements FragmentParallelizer { @Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters, final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException { final Stats stats = fragmentWrapper.getStats(); ... |
@Test public void multiAttrsInSamePOP() throws Exception { PlanFragmentsIndex.Builder indexBuilder = new PlanFragmentsIndex.Builder(); MinorDataSerDe serDe = new MinorDataSerDe(null, null); MinorDataWriter writer = new MinorDataWriter(null, dummyEndpoint, serDe, indexBuilder); MockStorePOP pop = new MockStorePOP(OpProp... | public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } } | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } MinorDataReader(
FragmentHandle handle,
MinorDataSerDe serDe,
PlanFragmentsIndex index,
MinorAttrsMap attrsMap); } | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } MinorDataReader(
FragmentHandle handle,
MinorDataSerDe serDe,
PlanFragmentsIndex index,
MinorAttrsMap attrsMap); FragmentHandle getHandle(); MinorFragmentIndexEndp... | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } MinorDataReader(
FragmentHandle handle,
MinorDataSerDe serDe,
PlanFragmentsIndex index,
MinorAttrsMap attrsMap); FragmentHandle getHandle(); MinorFragmentIndexEndp... |
@Test public void sameKeyMultiPOPs() throws Exception { PlanFragmentsIndex.Builder indexBuilder = new PlanFragmentsIndex.Builder(); MinorDataSerDe serDe = new MinorDataSerDe(null, null); MinorDataWriter writer = new MinorDataWriter(null, dummyEndpoint, serDe, indexBuilder); MockStorePOP pop1 = new MockStorePOP(OpProps.... | public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } } | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } MinorDataReader(
FragmentHandle handle,
MinorDataSerDe serDe,
PlanFragmentsIndex index,
MinorAttrsMap attrsMap); } | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } MinorDataReader(
FragmentHandle handle,
MinorDataSerDe serDe,
PlanFragmentsIndex index,
MinorAttrsMap attrsMap); FragmentHandle getHandle(); MinorFragmentIndexEndp... | MinorDataReader { public ByteString readProtoEntry(OpProps props, String key) throws Exception { return attrsMap.getAttrValue(props, key); } MinorDataReader(
FragmentHandle handle,
MinorDataSerDe serDe,
PlanFragmentsIndex index,
MinorAttrsMap attrsMap); FragmentHandle getHandle(); MinorFragmentIndexEndp... |
@Test public void testListDiscardsGivenExclusions() { when(excluded.getMaterializationFor(converter)).thenReturn(relOptMat1); when(excluded.getLayoutId()).thenReturn("rid-1"); when(included.getMaterializationFor(converter)).thenReturn(relOptMat2); when(included.getLayoutId()).thenReturn("rid-2"); SubstitutionSettings m... | @VisibleForTesting protected List<DremioMaterialization> build(final MaterializationDescriptorProvider provider) { final Set<String> exclusions = Sets.newHashSet(session.getSubstitutionSettings().getExclusions()); final Set<String> inclusions = Sets.newHashSet(session.getSubstitutionSettings().getInclusions()); final b... | MaterializationList implements MaterializationProvider { @VisibleForTesting protected List<DremioMaterialization> build(final MaterializationDescriptorProvider provider) { final Set<String> exclusions = Sets.newHashSet(session.getSubstitutionSettings().getExclusions()); final Set<String> inclusions = Sets.newHashSet(se... | MaterializationList implements MaterializationProvider { @VisibleForTesting protected List<DremioMaterialization> build(final MaterializationDescriptorProvider provider) { final Set<String> exclusions = Sets.newHashSet(session.getSubstitutionSettings().getExclusions()); final Set<String> inclusions = Sets.newHashSet(se... | MaterializationList implements MaterializationProvider { @VisibleForTesting protected List<DremioMaterialization> build(final MaterializationDescriptorProvider provider) { final Set<String> exclusions = Sets.newHashSet(session.getSubstitutionSettings().getExclusions()); final Set<String> inclusions = Sets.newHashSet(se... | MaterializationList implements MaterializationProvider { @VisibleForTesting protected List<DremioMaterialization> build(final MaterializationDescriptorProvider provider) { final Set<String> exclusions = Sets.newHashSet(session.getSubstitutionSettings().getExclusions()); final Set<String> inclusions = Sets.newHashSet(se... |
@Test public void testAreRowTypesEqualIgnoresNames() { final RelDataType type1 = typeFactory.createStructType( asList( typeFactory.createSqlType(SqlTypeName.INTEGER), typeFactory.createSqlType(SqlTypeName.BIGINT), typeFactory.createSqlType(SqlTypeName.FLOAT), typeFactory.createSqlType(SqlTypeName.DOUBLE), typeFactory.c... | @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataTypeField> f2 = rowType2.ge... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... |
@Test public void testParseJsonPath() throws Exception { JsonPath p = JSONElementLocator.parsePath("value.a"); assertEquals(p.toString(), 1, p.size()); assertEquals(p.toString(), "a", p.last().asObject().getField()); } | public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); static JsonPath parsePath(String pat... | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); static JsonPath parsePath(String pat... |
@Test public void testAreRowTypesEqualIgnoresNullability() { final RelDataType type1 = typeFactory.createStructType( asList( typeFactory.createSqlType(SqlTypeName.INTEGER), typeFactory.createSqlType(SqlTypeName.DOUBLE), typeFactory.createSqlType(SqlTypeName.TIMESTAMP), typeFactory.createSqlType(SqlTypeName.BOOLEAN) ), ... | @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataTypeField> f2 = rowType2.ge... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... |
@Test public void testAreRowTypesEqualIgnoresAny() { final RelDataType type1 = typeFactory.createStructType( asList( typeFactory.createSqlType(SqlTypeName.INTEGER), typeFactory.createSqlType(SqlTypeName.BIGINT) ), asList("intC", "bigIntC") ); final RelDataType type2 = typeFactory.createStructType( asList( typeFactory.c... | @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataTypeField> f2 = rowType2.ge... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... |
@Test public void testAreRowTypesEqualMatchesCharVarchar() { final RelDataType type1 = typeFactory.createStructType( asList( typeFactory.createSqlType(SqlTypeName.CHAR), typeFactory.createSqlType(SqlTypeName.VARCHAR) ), asList("charC", "varcharC") ); final RelDataType type2 = typeFactory.createStructType( asList( typeF... | @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataTypeField> f2 = rowType2.ge... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... |
@Test public void testTimestampPrecisionMismatch() { final RelDataTypeFactory calciteFactory = new org.apache.calcite.jdbc.JavaTypeFactoryImpl(); final RelDataType type1 = calciteFactory.createStructType( Collections.singletonList(calciteFactory.createSqlType(SqlTypeName.TIMESTAMP, 0)), Collections.singletonList("ts0")... | @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataTypeField> f2 = rowType2.ge... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... | MaterializationExpander { @VisibleForTesting static boolean areRowTypesEqual(RelDataType rowType1, RelDataType rowType2) { if (rowType1 == rowType2) { return true; } if (rowType2.getFieldCount() != rowType1.getFieldCount()) { return false; } final List<RelDataTypeField> f1 = rowType1.getFieldList(); final List<RelDataT... |
@Test public void testTableTypesEmptyList() { assertSame(MetadataProviderConditions.ALWAYS_TRUE, MetadataProviderConditions.getTableTypePredicate(Collections.emptyList())); } | public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } } | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } private MetadataProviderConditions(); } | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } private MetadataProviderConditions(); static Predicate<String> getTableTypePredicate(List<String> tableTy... | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } private MetadataProviderConditions(); static Predicate<String> getTableTypePredicate(List<String> tableTy... |
@Test public void testTableTypes() { Predicate<String> filter = MetadataProviderConditions.getTableTypePredicate(Arrays.asList("foo", "bar")); assertTrue(filter.test("foo")); assertTrue(filter.test("bar")); assertFalse(filter.test("baz")); assertFalse(filter.test("fooo")); assertFalse(filter.test("ofoo")); assertFalse(... | public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } } | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } private MetadataProviderConditions(); } | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } private MetadataProviderConditions(); static Predicate<String> getTableTypePredicate(List<String> tableTy... | MetadataProviderConditions { public static Predicate<String> getTableTypePredicate(List<String> tableTypeFilter) { return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains; } private MetadataProviderConditions(); static Predicate<String> getTableTypePredicate(List<String> tableTy... |
@Test public void testLikeFilterAlwaysTrue() { assertSame(MetadataProviderConditions.ALWAYS_TRUE, MetadataProviderConditions.getCatalogNamePredicate(null)); assertSame(MetadataProviderConditions.ALWAYS_TRUE, MetadataProviderConditions.getCatalogNamePredicate(newLikeFilter(null, "\\"))); assertSame(MetadataProviderCondi... | public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasEscape() ? filter.getEscape().... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... |
@Test public void testLikeFilter() { Predicate<String> filter = MetadataProviderConditions.getCatalogNamePredicate(newLikeFilter("abc", "\\")); assertTrue(filter.test("abc")); assertFalse(filter.test("abcd")); assertTrue(filter.test("ABC")); } | public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasEscape() ? filter.getEscape().... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... |
@Test public void testLikeFilterMixedCase() { Predicate<String> filter = MetadataProviderConditions.getCatalogNamePredicate(newLikeFilter("AbC", "\\")); assertTrue(filter.test("abc")); assertFalse(filter.test("abcd")); assertFalse(filter.test("aabc")); assertTrue(filter.test("ABC")); } | public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasEscape() ? filter.getEscape().... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... | MetadataProviderConditions { public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) { if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) { return ALWAYS_TRUE; } final String patternString = RegexpUtil.sqlToRegexLike(filter.getPattern(), filter.hasE... |
@Test public void testCreateFilterAlwaysTrue() { assertFalse(MetadataProviderConditions.createConjunctiveQuery(null, null).isPresent()); assertFalse(MetadataProviderConditions.createConjunctiveQuery(null, newLikeFilter("%", null)).isPresent()); assertFalse(MetadataProviderConditions.createConjunctiveQuery(newLikeFilter... | public static Optional<SearchQuery> createConjunctiveQuery( LikeFilter schemaNameFilter, LikeFilter tableNameFilter ) { final Optional<SearchQuery> schemaNameQuery = createLikeQuery(DatasetIndexKeys.UNQUOTED_SCHEMA.getIndexFieldName(), schemaNameFilter); final Optional<SearchQuery> tableNameQuery = createLikeQuery(Data... | MetadataProviderConditions { public static Optional<SearchQuery> createConjunctiveQuery( LikeFilter schemaNameFilter, LikeFilter tableNameFilter ) { final Optional<SearchQuery> schemaNameQuery = createLikeQuery(DatasetIndexKeys.UNQUOTED_SCHEMA.getIndexFieldName(), schemaNameFilter); final Optional<SearchQuery> tableNam... | MetadataProviderConditions { public static Optional<SearchQuery> createConjunctiveQuery( LikeFilter schemaNameFilter, LikeFilter tableNameFilter ) { final Optional<SearchQuery> schemaNameQuery = createLikeQuery(DatasetIndexKeys.UNQUOTED_SCHEMA.getIndexFieldName(), schemaNameFilter); final Optional<SearchQuery> tableNam... | MetadataProviderConditions { public static Optional<SearchQuery> createConjunctiveQuery( LikeFilter schemaNameFilter, LikeFilter tableNameFilter ) { final Optional<SearchQuery> schemaNameQuery = createLikeQuery(DatasetIndexKeys.UNQUOTED_SCHEMA.getIndexFieldName(), schemaNameFilter); final Optional<SearchQuery> tableNam... | MetadataProviderConditions { public static Optional<SearchQuery> createConjunctiveQuery( LikeFilter schemaNameFilter, LikeFilter tableNameFilter ) { final Optional<SearchQuery> schemaNameQuery = createLikeQuery(DatasetIndexKeys.UNQUOTED_SCHEMA.getIndexFieldName(), schemaNameFilter); final Optional<SearchQuery> tableNam... |
@Test public void testParseJsonPath2() throws Exception { JsonPath p = JSONElementLocator.parsePath("value.a.b.c"); assertEquals(p.toString(), 3, p.size()); assertEquals(new JsonPath(new ObjectJsonPathElement("a"), new ObjectJsonPathElement("b"), new ObjectJsonPathElement("c")), p); } | public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); static JsonPath parsePath(String pat... | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); static JsonPath parsePath(String pat... |
@Test public void testCreationOfValidator() { SabotContext sabotContext = mock(SabotContext.class); FunctionImplementationRegistry functionImplementationRegistry = mock(FunctionImplementationRegistry.class); CatalogService catalogService = mock(CatalogService.class); Catalog catalog = mock(Catalog.class); ProjectOption... | public static SQLAnalyzer createSQLAnalyzer(final String username, final SabotContext sabotContext, final List<String> context, final boolean createForSqlSuggestions, ProjectOptionManager projectOptionManager) { final ViewExpansionContext viewExpansionContext = new ViewExpansionContext(username); final OptionManager op... | SQLAnalyzerFactory { public static SQLAnalyzer createSQLAnalyzer(final String username, final SabotContext sabotContext, final List<String> context, final boolean createForSqlSuggestions, ProjectOptionManager projectOptionManager) { final ViewExpansionContext viewExpansionContext = new ViewExpansionContext(username); f... | SQLAnalyzerFactory { public static SQLAnalyzer createSQLAnalyzer(final String username, final SabotContext sabotContext, final List<String> context, final boolean createForSqlSuggestions, ProjectOptionManager projectOptionManager) { final ViewExpansionContext viewExpansionContext = new ViewExpansionContext(username); f... | SQLAnalyzerFactory { public static SQLAnalyzer createSQLAnalyzer(final String username, final SabotContext sabotContext, final List<String> context, final boolean createForSqlSuggestions, ProjectOptionManager projectOptionManager) { final ViewExpansionContext viewExpansionContext = new ViewExpansionContext(username); f... | SQLAnalyzerFactory { public static SQLAnalyzer createSQLAnalyzer(final String username, final SabotContext sabotContext, final List<String> context, final boolean createForSqlSuggestions, ProjectOptionManager projectOptionManager) { final ViewExpansionContext viewExpansionContext = new ViewExpansionContext(username); f... |
@Test(expected = UserException.class) public void testFailMultipleQueries() { ParserConfig config = new ParserConfig(ParserConfig.QUOTING, 100); SqlConverter.parseSingleStatementImpl("select * from t1; select * from t2", config, false); } | @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(); String first... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... |
@Test public void testPassSemicolon() { ParserConfig config = new ParserConfig(ParserConfig.QUOTING, 100); SqlNode node = SqlConverter.parseSingleStatementImpl("select * from t1;", config, false); assertEquals("SELECT *\n" + "FROM \"t1\"", node.toSqlString(CalciteSqlDialect.DEFAULT).getSql()); } | @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(); String first... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... | SqlConverter { @VisibleForTesting static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) { SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery); if (list.size() > 1) { SqlParserPos pos = list.get(1).getParserPosition(); int col = pos.getColumnNum(... |
@Test public void testSuggestion() { final SqlParserUtil.StringAndPos stringAndPos = SqlParserUtil.findPos(sql); List<SqlMoniker> suggestions = sqlAnalyzer.suggest(stringAndPos.sql, stringAndPos.cursor); assertEquals(expectedSuggestionCount, suggestions.size()); if (checkSuggestions) { assertSuggestions(suggestions); }... | public List<SqlMoniker> suggest(String sql, int cursorPosition) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); String[] replaced = {null}; return sqlAdvisor.getCompletionHints(sql, cursorPosition , replaced); } | SQLAnalyzer { public List<SqlMoniker> suggest(String sql, int cursorPosition) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); String[] replaced = {null}; return sqlAdvisor.getCompletionHints(sql, cursorPosition , replaced); } } | SQLAnalyzer { public List<SqlMoniker> suggest(String sql, int cursorPosition) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); String[] replaced = {null}; return sqlAdvisor.getCompletionHints(sql, cursorPosition , replaced); } protected SQLAnalyzer(final SqlValidatorWithHints validator); } | SQLAnalyzer { public List<SqlMoniker> suggest(String sql, int cursorPosition) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); String[] replaced = {null}; return sqlAdvisor.getCompletionHints(sql, cursorPosition , replaced); } protected SQLAnalyzer(final SqlValidatorWithHints validator); List<SqlMoniker> suggest(S... | SQLAnalyzer { public List<SqlMoniker> suggest(String sql, int cursorPosition) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); String[] replaced = {null}; return sqlAdvisor.getCompletionHints(sql, cursorPosition , replaced); } protected SQLAnalyzer(final SqlValidatorWithHints validator); List<SqlMoniker> suggest(S... |
@Test public void testValidation() { List<SqlAdvisor.ValidateErrorInfo> validationErrors = sqlAnalyzer.validate("select * from"); assertEquals(1, validationErrors.size()); assertEquals(10, validationErrors.get(0).getStartColumnNum()); assertEquals(13, validationErrors.get(0).getEndColumnNum()); } | public List<SqlAdvisor.ValidateErrorInfo> validate(String sql) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); return sqlAdvisor.validate(sql); } | SQLAnalyzer { public List<SqlAdvisor.ValidateErrorInfo> validate(String sql) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); return sqlAdvisor.validate(sql); } } | SQLAnalyzer { public List<SqlAdvisor.ValidateErrorInfo> validate(String sql) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); return sqlAdvisor.validate(sql); } protected SQLAnalyzer(final SqlValidatorWithHints validator); } | SQLAnalyzer { public List<SqlAdvisor.ValidateErrorInfo> validate(String sql) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); return sqlAdvisor.validate(sql); } protected SQLAnalyzer(final SqlValidatorWithHints validator); List<SqlMoniker> suggest(String sql, int cursorPosition); List<SqlAdvisor.ValidateErrorInfo>... | SQLAnalyzer { public List<SqlAdvisor.ValidateErrorInfo> validate(String sql) { SqlAdvisor sqlAdvisor = new SqlAdvisor(validator); return sqlAdvisor.validate(sql); } protected SQLAnalyzer(final SqlValidatorWithHints validator); List<SqlMoniker> suggest(String sql, int cursorPosition); List<SqlAdvisor.ValidateErrorInfo>... |
@Test public void simpleSelectNoLimit() { Prel input = newScreen( newProject(exprs(), rowType(), newUnionExchange( newProject(exprs(), rowType(), newSoftScan(rowType()) ) ) ) ); Prel output = SimpleLimitExchangeRemover.apply(plannerSettings, input); verifyOutput(output, "Screen", "Project", "UnionExchange", "Project", ... | public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... |
@Test public void simpleSelectWithLimitWithSoftScan() { Prel input = newScreen( newLimit(0, 10, newProject(exprs(), rowType(), newUnionExchange( newLimit(0, 10, newProject(exprs(), rowType(), newSoftScan(rowType()) ) ) ) ) ) ); Prel output = SimpleLimitExchangeRemover.apply(plannerSettings, input); verifyOutput(output,... | public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... |
@Test public void simpleSelectWithLimitWithSoftScanWithLeafLimitsEnabled() { OptionValue optionEnabled = OptionValue.createBoolean(OptionValue.OptionType.QUERY, PlannerSettings.ENABLE_LEAF_LIMITS.getOptionName(), true); when(optionManager.getOption(PlannerSettings.ENABLE_LEAF_LIMITS.getOptionName())).thenReturn(optionE... | public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... |
@Test public void simpleSelectWithLargeLimitWithSoftScan() { Prel input = newScreen( newLimit(0, 200000, newProject(exprs(), rowType(), newUnionExchange( newLimit(0, 200000, newProject(exprs(), rowType(), newSoftScan(rowType()) ) ) ) ) ) ); Prel output = SimpleLimitExchangeRemover.apply(plannerSettings, input); verifyO... | public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... |
@Test public void simpleSelectWithLimitWithHardScan() { Prel input = newScreen( newLimit(0, 10, newProject(exprs(), rowType(), newUnionExchange( newLimit(0, 10, newProject(exprs(), rowType(), newHardScan(rowType()) ) ) ) ) ) ); Prel output = SimpleLimitExchangeRemover.apply(plannerSettings, input); verifyOutput(output,... | public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... |
@Test public void testParseJsonPath3() throws Exception { JsonPath p = JSONElementLocator.parsePath("value[0][1][2]"); assertEquals(p.toString(), 3, p.size()); assertEquals(new JsonPath(new ArrayJsonPathElement(0), new ArrayJsonPathElement(1), new ArrayJsonPathElement(2)), p); } | public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); } | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); static JsonPath parsePath(String pat... | JSONElementLocator { public static JsonPath parsePath(String path) { if (path.startsWith(VALUE_PLACEHOLDER)) { return new JsonPath(path.substring(VALUE_PLACEHOLDER.length())); } throw new IllegalArgumentException(path + " must start with 'value'"); } JSONElementLocator(String text); static JsonPath parsePath(String pat... |
@Test public void joinWithLimitWithSoftScan() { Prel input = newScreen( newLimit(0, 10, newProject(exprs(), rowType(), newUnionExchange( newJoin( newProject(exprs(), rowType(), newSoftScan(rowType()) ), newProject(exprs(), rowType(), newSoftScan(rowType()) ) ) ) ) ) ); Prel output = SimpleLimitExchangeRemover.apply(pla... | public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } } | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... | SimpleLimitExchangeRemover { public static Prel apply(PlannerSettings settings, Prel input){ if(!settings.isTrivialSingularOptimized() || settings.isLeafLimitsEnabled()) { return input; } if(input.accept(new Identifier(), false)){ return input.accept(new AllExchangeRemover(), null); } return input; } static Prel apply... |
@Test public void testRuleNoMatch() throws Exception { final TestScanPrel scan = new TestScanPrel(cluster, TRAITS, table, pluginId, metadata, PROJECTED_COLUMNS, 0, true); final LimitPrel limitNode = new LimitPrel(cluster, TRAITS, scan, REX_BUILDER.makeExactLiteral(BigDecimal.valueOf(offset)), REX_BUILDER.makeExactLiter... | @Override public boolean matches(RelOptRuleCall call) { return !((ScanPrelBase) call.rel(1)).hasFilter() && call.rel(1) instanceof PruneableScan; } | PushLimitToPruneableScan extends Prule { @Override public boolean matches(RelOptRuleCall call) { return !((ScanPrelBase) call.rel(1)).hasFilter() && call.rel(1) instanceof PruneableScan; } } | PushLimitToPruneableScan extends Prule { @Override public boolean matches(RelOptRuleCall call) { return !((ScanPrelBase) call.rel(1)).hasFilter() && call.rel(1) instanceof PruneableScan; } private PushLimitToPruneableScan(); } | PushLimitToPruneableScan extends Prule { @Override public boolean matches(RelOptRuleCall call) { return !((ScanPrelBase) call.rel(1)).hasFilter() && call.rel(1) instanceof PruneableScan; } private PushLimitToPruneableScan(); @Override boolean matches(RelOptRuleCall call); @Override void onMatch(RelOptRuleCall call); } | PushLimitToPruneableScan extends Prule { @Override public boolean matches(RelOptRuleCall call) { return !((ScanPrelBase) call.rel(1)).hasFilter() && call.rel(1) instanceof PruneableScan; } private PushLimitToPruneableScan(); @Override boolean matches(RelOptRuleCall call); @Override void onMatch(RelOptRuleCall call); s... |
@Test public void testUnderflowSize() { KeyFairSliceCalculator keyFairSliceCalculator = new KeyFairSliceCalculator(newHashMap("k1", 4, "k2", 4, "k3", 4), 16); assertEquals("Invalid combined key size", 13, keyFairSliceCalculator.getTotalSize()); } | public int getTotalSize() { return totalSize; } | KeyFairSliceCalculator { public int getTotalSize() { return totalSize; } } | KeyFairSliceCalculator { public int getTotalSize() { return totalSize; } KeyFairSliceCalculator(Map<String, Integer> originalKeySizes, int maxTotalSize); } | KeyFairSliceCalculator { public int getTotalSize() { return totalSize; } KeyFairSliceCalculator(Map<String, Integer> originalKeySizes, int maxTotalSize); Integer getKeySlice(String key); int getTotalSize(); boolean keysTrimmed(); int numValidityBytes(); } | KeyFairSliceCalculator { public int getTotalSize() { return totalSize; } KeyFairSliceCalculator(Map<String, Integer> originalKeySizes, int maxTotalSize); Integer getKeySlice(String key); int getTotalSize(); boolean keysTrimmed(); int numValidityBytes(); } |
@Test public void testDictionaryFileName() throws Exception { assertEquals("_foo.dict", GlobalDictionaryBuilder.dictionaryFileName("foo")); assertEquals("_a.b.c.dict", GlobalDictionaryBuilder.dictionaryFileName("a.b.c")); assertEquals("_foo.dict", GlobalDictionaryBuilder.dictionaryFileName(new ColumnDescriptor(new Stri... | public static String dictionaryFileName(String columnFullPath) { return format("_%s.%s", columnFullPath, DICTIONARY_FILES_EXTENSION); } | GlobalDictionaryBuilder { public static String dictionaryFileName(String columnFullPath) { return format("_%s.%s", columnFullPath, DICTIONARY_FILES_EXTENSION); } } | GlobalDictionaryBuilder { public static String dictionaryFileName(String columnFullPath) { return format("_%s.%s", columnFullPath, DICTIONARY_FILES_EXTENSION); } } | GlobalDictionaryBuilder { public static String dictionaryFileName(String columnFullPath) { return format("_%s.%s", columnFullPath, DICTIONARY_FILES_EXTENSION); } static String dictionaryFileName(String columnFullPath); static String dictionaryFileName(ColumnDescriptor columnDescriptor); static Path dictionaryFilePath(... | GlobalDictionaryBuilder { public static String dictionaryFileName(String columnFullPath) { return format("_%s.%s", columnFullPath, DICTIONARY_FILES_EXTENSION); } static String dictionaryFileName(String columnFullPath); static String dictionaryFileName(ColumnDescriptor columnDescriptor); static Path dictionaryFilePath(... |
@Test public void testExtractColumnName() throws Exception { assertEquals("foo", GlobalDictionaryBuilder.getColumnFullPath("_foo.dict")); assertEquals("a.b.c", GlobalDictionaryBuilder.getColumnFullPath("_a.b.c.dict")); } | public static String getColumnFullPath(String dictionaryFileName) { final Matcher matcher = DICTIONARY_FILES_PATTERN.matcher(dictionaryFileName); if (matcher.find()) { return matcher.group(1); } return null; } | GlobalDictionaryBuilder { public static String getColumnFullPath(String dictionaryFileName) { final Matcher matcher = DICTIONARY_FILES_PATTERN.matcher(dictionaryFileName); if (matcher.find()) { return matcher.group(1); } return null; } } | GlobalDictionaryBuilder { public static String getColumnFullPath(String dictionaryFileName) { final Matcher matcher = DICTIONARY_FILES_PATTERN.matcher(dictionaryFileName); if (matcher.find()) { return matcher.group(1); } return null; } } | GlobalDictionaryBuilder { public static String getColumnFullPath(String dictionaryFileName) { final Matcher matcher = DICTIONARY_FILES_PATTERN.matcher(dictionaryFileName); if (matcher.find()) { return matcher.group(1); } return null; } static String dictionaryFileName(String columnFullPath); static String dictionaryFi... | GlobalDictionaryBuilder { public static String getColumnFullPath(String dictionaryFileName) { final Matcher matcher = DICTIONARY_FILES_PATTERN.matcher(dictionaryFileName); if (matcher.find()) { return matcher.group(1); } return null; } static String dictionaryFileName(String columnFullPath); static String dictionaryFi... |
@Test public void syntheticSimple() { ConfigurableOperator cnb = new ConfigurableOperator(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithBound(false).cloneWithMemoryFactor(2.0d), ARBTRIARY_LEAF); ConfigurableOperator cb = new ConfigurableOperator(OpProps.prototype(1, Long.MAX_VALUE).cloneW... | @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOperator> nonConsideredOps = Ar... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... |
@Test public void doubleSort() { ExternalSort es1 = new ExternalSort(OpProps.prototype().cloneWithNewReserve(0).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), ARBTRIARY_LEAF, Collections.emptyList(), false); ExternalSort es2 = new Ex... | @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOperator> nonConsideredOps = Ar... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... | MemoryAllocationUtilities { @VisibleForTesting static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) { final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create(); final ArrayListMultimap<NodeEndpoint, PhysicalOpe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.