auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Table getTable(String tableName) { DynamicDrillTable table = activeTables.get(name); if (table != null) { return table; } if (!activeTables.containsKey(name)) { return registerTable(name, new DynamicDrillTable(plugin, pluginName, new HttpScanSpec(pluginName, name, tableName, plugin.getConfig()))); } return null; }

Target:
public Table getTable(String tableName) { DynamicDrillTable table = activeTables.get(name); if (table != null) { // Return the found table return table; } else { // Register a new table return registerTable(name, new DynamicDrillTable(plugin, pluginName, new HttpScanSpec(pluginName, name, tableName, plugin.getConfig()))); } }
Source:
public int getMaxParallelizationWidth() { return 0; }

Target:
public int getMaxParallelizationWidth() { return 1; }
Source:
public void registerSchemas(SchemaConfig schemaConfig, SchemaPlus parent) throws IOException { HttpSchema schema = new HttpSchema(getName()); logger.debug("Registering {}", schema.getName(), schema.toString()); SchemaPlus schemaPlus = parent.add(getName(), schema); schema.setHolder(schemaPlus); }

Target:
public void registerSchemas(SchemaConfig schemaConfig, SchemaPlus parent) { HttpSchema schema = new HttpSchema(getName()); logger.debug("Registering {}", schema.getName(), schema.toString()); SchemaPlus schemaPlus = parent.add(getName(), schema); schema.setHolder(schemaPlus); }
Source:
public SubScan getSpecificScan(int minorFragmentId) { logger.debug("HttpGroupScan getSpecificScan"); return new HttpSubScan(config, httpScanSpec, columns); }

Target:
public SubScan getSpecificScan(int minorFragmentId) { return new HttpSubScan(config, httpScanSpec, columns); }
Source:
public AbstractSchema getSubSchema(String name) { try { if (!plugin.getConfig().connections().containsKey(name)) { throw UserException .connectionError() .message("API '{}' does not exist in HTTP Storage plugin '{}'", name, getName()) .build(logger); } return getSubSchemaKnownExists(name); } catch (Exception e) { throw new DrillRuntimeException(e); } }

Target:
public AbstractSchema getSubSchema(String name) { if (plugin.getConfig().connections().containsKey(name)) { return getSubSchemaKnownExists(name); } else { throw UserException .connectionError() .message("API '{}' does not exist in HTTP Storage plugin '{}'", name, getName()) .build(logger); } }
Source:
public BasicAuthInterceptor(String user, String password) { credentials = Credentials.basic(user, password); logger.debug("Intercepting request adding creds: {}", credentials); }

Target:
public BasicAuthInterceptor(String user, String password) { credentials = Credentials.basic(user, password); }
Source:
public AbstractGroupScan getPhysicalScan(String userName, JSONOptions selection) throws IOException { DruidScanSpec scanSpec = selection.getListWith(new ObjectMapper(), new TypeReference<DruidScanSpec>() {}); return new DruidGroupScan(userName, this, scanSpec, null); }

Target:
public DruidGroupScan getPhysicalScan(String userName, JSONOptions selection) throws IOException { DruidScanSpec scanSpec = selection.getListWith(new ObjectMapper(), new TypeReference<DruidScanSpec>() {}); return new DruidGroupScan(userName, this, scanSpec, null, -1); }
Source:
DruidScanSpec build(String dataSourceName, String functionName, SchemaPath field, Object fieldValue) throws IOException { // extract the field name String fieldName = field.getAsNamePart().getName(); DruidFilter filter = translateFilter(functionName, fieldName, String.valueOf(fieldValue)); logger.debug("createDruidScanSpec called. FunctionName - " + functionName + ", field - " + fieldName + ", fieldValue - " + fieldValue); DruidScanSpec scanSpec = new DruidScanSpec(dataSourceName, filter); logger.debug("Created new DruidScanSpec with filter - " + filter + " for DataSource - " + dataSourceName); return scanSpec; }

Target:
DruidScanSpec build(String dataSourceName, String functionName, SchemaPath field, Object fieldValue) { String fieldName = field.getAsNamePart().getName(); DruidFilter filter = translateFilter(functionName, fieldName, String.valueOf(fieldValue)); return (filter == null) ? null : new DruidScanSpec(dataSourceName, filter); }
Source:
public boolean matches(RelOptRuleCall call) { final ScanPrel scan = (ScanPrel) call.rel(1); if (scan.getGroupScan() instanceof DruidGroupScan) { return super.matches(call); } return false; }

Target:
public boolean matches(RelOptRuleCall call) { final ScanPrel scan = call.rel(1); if (scan.getGroupScan() instanceof DruidGroupScan) { return super.matches(call); } return false; }
Source:
public DruidScanSpec parseTree() throws JsonProcessingException { logger.debug("DruidScanSpec parseTree() called."); DruidScanSpec parsedSpec = le.accept(this, null); if (parsedSpec != null) { parsedSpec = mergeScanSpecs( FunctionNames.AND, this.groupScan.getScanSpec(), parsedSpec ); } return parsedSpec; }

Target:
public DruidScanSpec parseTree() { logger.debug("DruidScanSpec parseTree() called."); DruidScanSpec parsedSpec = le.accept(this, null); if (parsedSpec != null) { parsedSpec = mergeScanSpecs( FunctionNames.AND, this.groupScan.getScanSpec(), parsedSpec ); } return parsedSpec; }
Source:
public DruidDataSources(String name) { super(ImmutableList.<String>of(), name); this.tableNames = this.getTableNames(); }

Target:
public DruidDataSources(String name) { super(ImmutableList.of(), name); this.tableNames = this.getTableNames(); }
Source:
public void clearStack() { super.clearStack(); localVariablesSet.clear(); labelsStack.clear(); }

Target:
public void clearStack() { super.clearStack(); localVariablesSet = null; labelsStack = null; }
Source:
private static Map<Class<? extends RecordBatch>, CheckMode> buildRules() { Map<Class<? extends RecordBatch>, CheckMode> rules = new IdentityHashMap<>(); rules.put(OperatorRecordBatch.class, CheckMode.ALL); return rules; }

Target:
private static Map<Class<? extends RecordBatch>, CheckMode> buildRules() { final Map<Class<? extends RecordBatch>, CheckMode> rules = new IdentityHashMap<>(); //rules.put(OperatorRecordBatch.class, CheckMode.ALL); return rules; }
Source:
public List<String> getExtensions() { if (extensions == null) { return DEFAULT_EXTS; } return extensions; }

Target:
public List<String> getExtensions() { return extensions == null ? DEFAULT_EXTS : extensions; }
Source:
public List<String> getExtensions() { if (extensions == null) { return DEFAULT_EXTS; } return extensions; }

Target:
public List<String> getExtensions() { return extensions; }
Source:
public boolean next() { if (fileReaderShp == null) { return false; } Geometry geom = null; while( !rowWriter.isFull()){ Object[] dbfRow = dbfReader.nextRecord(); geom = geomCursor.next(); if(geom == null) { return false; } processShapefileSet(rowWriter, geomCursor.getGeometryID(), geom, dbfRow); } return true; }

Target:
public boolean next() { Geometry geom = null; while (!rowWriter.isFull()) { Object[] dbfRow = dbfReader.nextRecord(); geom = geomCursor.next(); if (geom == null) { return false; } processShapefileSet(rowWriter, geomCursor.getGeometryID(), geom, dbfRow); } return true; }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ShpFormatConfig other = (ShpFormatConfig)obj; return Objects.equal(extensions, other.getExtensions() ); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ShpFormatConfig other = (ShpFormatConfig)obj; return Objects.equals(extensions, other.getExtensions()); }
Source:
public IcebergMetastore(DrillConfig config) { this.config = config; Configuration configuration = configuration(config); this.tables = new HadoopTables(new Configuration(configuration)); this.baseLocation = baseLocation(config, new Configuration(configuration)); this.commonProperties = properties(config, IcebergConfigConstants.COMPONENTS_COMMON_PROPERTIES); this.expirationHandler = new ExpirationHandler(config, new Configuration(configuration)); }

Target:
public IcebergMetastore(DrillConfig config) { this.config = config; Configuration configuration = configuration(); this.tables = new HadoopTables(new Configuration(configuration)); this.baseLocation = baseLocation(new Configuration(configuration)); this.commonProperties = properties(IcebergConfigConstants.COMPONENTS_COMMON_PROPERTIES); this.expirationHandler = new ExpirationHandler(config, new Configuration(configuration)); }
Source:
public ColumnMetadata_v4(String[] name, PrimitiveType.PrimitiveTypeName primitiveType, Object minValue, Object maxValue, Long nulls) { this(name, primitiveType, minValue, maxValue, nulls, new ArrayList<>()); }

Target:
public ColumnMetadata_v4(String[] name, PrimitiveType.PrimitiveTypeName primitiveType, Object minValue, Object maxValue, Long nulls) { super(name, primitiveType, minValue, maxValue, nulls); }
Source:
public static boolean isSortable(MinorType type) { // Currently only map, list and dict columns are not sortable. return type != MinorType.MAP && type != MinorType.LIST && type != MinorType.DICT; }

Target:
public static boolean isSortable(MinorType type) { switch (type) { case DICT: case LIST: case MAP: return false; default: return true; } }
Source:
public void clear() { getMutator().reset(); offsets.clear(); for(final ValueVector vector : getChildren()) { vector.clear(); } }

Target:
public void clear() { getMutator().reset(); offsets.clear(); for (ValueVector vector : getChildren()) { vector.clear(); } }
Source:
public void testUnionSchema() { thrown.expect(UnsupportedOperationException.class); thrown.expectMessage(containsString("Unsupported data type")); convertType("uniontype<int,double>"); }

Target:
public void testUnionSchema() { thrown.expect(UnsupportedOperationException.class); convertType("uniontype<int,double>"); }
Source:
private static void verifyConversion(String hiveType, TypeProtos.MajorType type) { assertEquals(new PrimitiveColumnMetadata("a", type).columnString(), convertType(hiveType).columnString()); }

Target:
private void verifyConversion(String hiveType, TypeProtos.MajorType type) { assertEquals(new PrimitiveColumnMetadata("a", type).columnString(), convertType(hiveType).columnString()); }
Source:
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { // REVIEW jvs 9-Apr-2006: Just for now... return planner.getCostFactory().makeTinyCost(); }

Target:
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return planner.getCostFactory().makeTinyCost(); }
Source:
public static List<StatisticsHolder> getEstimatedTableStats(DrillStatsTable statsProvider) { if (statsProvider != null && statsProvider.isMaterialized()) { List<StatisticsHolder> tableStatistics = new ArrayList<>(); tableStatistics.add(new StatisticsHolder<>(statsProvider.getRowCount(), TableStatisticsKind.EST_ROW_COUNT)); tableStatistics.add(new StatisticsHolder<>(Boolean.TRUE, TableStatisticsKind.HAS_DESCRIPTIVE_STATISTICS)); return tableStatistics; } return Collections.emptyList(); }

Target:
public static List<StatisticsHolder> getEstimatedTableStats(DrillStatsTable statsProvider) { if (statsProvider != null && statsProvider.isMaterialized()) { List<StatisticsHolder> tableStatistics = Arrays.asList( new StatisticsHolder<>(statsProvider.getRowCount(), TableStatisticsKind.EST_ROW_COUNT), new StatisticsHolder<>(Boolean.TRUE, TableStatisticsKind.HAS_DESCRIPTIVE_STATISTICS)); return tableStatistics; } return Collections.emptyList(); }
Source:
protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { // Drill registers schemas in lower case, see AbstractSchema constructor schemaName = schemaName != null ? schemaName.toLowerCase() : null; CalciteSchema retSchema = getSubSchemaMap().get(schemaName); if (retSchema != null) { return retSchema; } loadSchemaFactory(schemaName, caseSensitive); retSchema = getSubSchemaMap().get(schemaName); return retSchema; }

Target:
protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { // Drill registers schemas in lower case, see AbstractSchema constructor schemaName = schemaName == null ? null : schemaName.toLowerCase(); CalciteSchema retSchema = getSubSchemaMap().get(schemaName); if (retSchema != null) { return retSchema; } loadSchemaFactory(schemaName, caseSensitive); retSchema = getSubSchemaMap().get(schemaName); return retSchema; }
Source:
protected SchemaNegotiatorImpl newNegotiator() { SchemaNegotiatorImpl nego = new FileSchemaNegotiatorImpl(this); String tableName = Path.getPathWithoutSchemeAndAuthority(currentSplit.getPath()).toString(); if (currentSplit.getStart() != 0) { tableName += String.format(", offset %,d", currentSplit.getStart()); } nego.setTableName(tableName); return nego; }

Target:
protected SchemaNegotiatorImpl newNegotiator() { return new FileSchemaNegotiatorImpl(this); }
Source:
public HDF5DataWriter(IHDF5Reader reader, RowSetLoader columnWriter, String datapath) { this.reader = reader; this.columnWriter = columnWriter; this.datapath = datapath; counter = 0; }

Target:
public HDF5DataWriter(IHDF5Reader reader, RowSetLoader columnWriter, String datapath) { this.reader = reader; this.columnWriter = columnWriter; this.datapath = datapath; }
Source:
MinorType getDataType(){ return dataType; }

Target:
public MinorType getDataType(){ return dataType; }
Source:
String getKey() { return key; }

Target:
public String getKey() { return key; }
Source:
String getDataType() { return dataType; }

Target:
public String getDataType() { return dataType; }
Source:
private ArrayList<String> getFieldNames() { ArrayList<String> names = new ArrayList<>(); HDF5CompoundMemberInformation[] infos = reader.compound().getDataSetInfo(datapath); for (HDF5CompoundMemberInformation info : infos) { names.add(info.getName().replace(UNSAFE_SPACE_SEPARATOR, SAFE_SPACE_SEPARATOR)); } return names; }

Target:
private List<String> getFieldNames() { List<String> names = new ArrayList<>(); HDF5CompoundMemberInformation[] infos = reader.compound().getDataSetInfo(datapath); for (HDF5CompoundMemberInformation info : infos) { names.add(info.getName().replace(UNSAFE_SPACE_SEPARATOR, SAFE_SPACE_SEPARATOR)); } return names; }
Source:
public HDF5DrillMetadata() { attributes = new HashMap(); }

Target:
public HDF5DrillMetadata() { attributes = new HashMap<>(); }
Source:
public List<Object> getColumn(int columnIndex) { List<Object> result = new ArrayList<Object>(); for (Object[] compoundDatum : compoundData) { result.add(compoundDatum[columnIndex]); } return result; }

Target:
public List<Object> getColumn(int columnIndex) { List<Object> result = new ArrayList<>(); for (Object[] compoundDatum : compoundData) { result.add(compoundDatum[columnIndex]); } return result; }
Source:
public static void setup() throws Exception { ProtobufPatcher.patch(); GuavaPatcher.patch(); ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher); startCluster(builder); HDF5FormatConfig formatConfig = new HDF5FormatConfig(); cluster.defineFormat("dfs", "hdf5", formatConfig); dirTestWatcher.copyResourceToRoot(Paths.get("hdf5/")); }

Target:
public static void setup() throws Exception { ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher); startCluster(builder); HDF5FormatConfig formatConfig = new HDF5FormatConfig(); cluster.defineFormat("dfs", "hdf5", formatConfig); dirTestWatcher.copyResourceToRoot(Paths.get("hdf5/")); }
Source:
public TupleSchema(@JsonProperty("columns") List<AbstractColumnMetadata> columns, @JsonProperty("properties") Map<String, String> properties) { if (columns != null && !columns.isEmpty()) { columns.forEach(this::addColumn); } setProperties(properties); }

Target:
public TupleSchema(@JsonProperty("columns") List<AbstractColumnMetadata> columns, @JsonProperty("properties") Map<String, String> properties) { if (columns != null) { columns.forEach(this::addColumn); } setProperties(properties); }
Source:
private static Set<RexInputRef> findAllRexInputRefs(final RexNode node) { Set<RexInputRef> rexRefs = new HashSet<>(); RexVisitor<Void> visitor = new RexVisitorImpl<Void>(true) { public Void visitInputRef(RexInputRef inputRef) { rexRefs.add(inputRef); return super.visitInputRef(inputRef); } }; node.accept(visitor); return rexRefs; }

Target:
private static List<RexInputRef> findAllRexInputRefs(final RexNode node) { List<RexInputRef> rexRefs = new ArrayList<>(); RexVisitor<Void> visitor = new RexVisitorImpl<Void>(true) { public Void visitInputRef(RexInputRef inputRef) { rexRefs.add(inputRef); return super.visitInputRef(inputRef); } }; node.accept(visitor); return rexRefs; }
Source:
public Map<String, String> getQueryOptions() { // Skip reporting QUERY_MAX_ROWS if it is inapplicable and set to zero (e.g. query -> SHOW FILES) return getOptions(o -> OptionValue.OptionScope.QUERY == o.getScope() && !(ExecConstants.QUERY_MAX_ROWS.equals(o.getName()) && String.valueOf(o.getValue()).equals("0"))); }

Target:
public Map<String, String> getQueryOptions() { return getOptions(o -> OptionValue.OptionScope.QUERY == o.getScope()); }
Source:
public List<? extends MetadataBase.ColumnTypeMetadata> getColumnTypeInfoList() { return new ArrayList(this.columnTypeInfo.values()); }

Target:
public List<? extends MetadataBase.ColumnTypeMetadata> getColumnTypeInfoList() { return new ArrayList<>(this.columnTypeInfo.values()); }
Source:
public void setLargeMaxRows(long maxRowCount) throws SQLException { super.setLargeMaxRows(maxRowCount); try (Statement statement = this.connection.createStatement()) { statement.execute("ALTER SESSION SET `" + ExecConstants.QUERY_MAX_ROWS + "`=" + maxRowCount); statement.close(); } }

Target:
public void setLargeMaxRows(long maxRowCount) throws SQLException { super.setLargeMaxRows(maxRowCount); try (Statement statement = this.connection.createStatement()) { statement.execute("ALTER SESSION SET `" + ExecConstants.QUERY_MAX_ROWS + "`=" + maxRowCount); } }
Source:
public static void tearDownConnection() throws SQLException { if (connection != null) { try (Statement stmt = connection.createStatement()) { stmt.execute(String.format("alter session set `%s` = false", PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY)); } } connection.close(); }

Target:
public static void tearDownConnection() throws SQLException { if (connection != null) { connection.close(); } }
Source:
public static List<String> getPartitionColumnNames(FileSelection selection, SchemaConfig schemaConfig) { int partitionsCount = getPartitionDepth(selection); String partitionColumnLabel = schemaConfig.getOption(ExecConstants.FILESYSTEM_PARTITION_COLUMN_LABEL).string_val; List<String> partitions = Lists.newArrayList(); // generates partition column names: dir0, dir1 etc. for (int i = 0; i < partitionsCount; i++) { partitions.add(partitionColumnLabel + i); } return partitions; }

Target:
public static List<String> getPartitionColumnNames(FileSelection selection, SchemaConfig schemaConfig) { int partitionsCount = getPartitionDepth(selection); String partitionColumnLabel = schemaConfig.getOption( ExecConstants.FILESYSTEM_PARTITION_COLUMN_LABEL).string_val; List<String> partitions = new ArrayList<>(); // generates partition column names: dir0, dir1 etc. for (int i = 0; i < partitionsCount; i++) { partitions.add(partitionColumnLabel + i); } return partitions; }
Source:
public Builder(DrillBuf managedBuf) { this.managedBuf = managedBuf; this.workingBuffer = new WorkingBuffer(managedBuf); this.mapOutput = new MapVectorOutput(workingBuffer); this.listOutput = new ListVectorOutput(workingBuffer); this.readNumbersAsDouble = false; this.skipOuterList = false; this.allTextMode = false; this.enableNanInf = true; this.enableEscapeAnyChar = false; }

Target:
public Builder(DrillBuf managedBuf) { this.managedBuf = managedBuf; this.workingBuffer = new WorkingBuffer(managedBuf); this.mapOutput = new MapVectorOutput(workingBuffer); this.listOutput = new ListVectorOutput(workingBuffer); this.enableNanInf = true; }
Source:
private static File getWebServerTempDirPath(Drillbit drillbit) { File webServerTempDirPath = null; try { Field webServerField = FieldUtils.getField(drillbit.getClass(), "webServer", true); WebServer webServerHandle = (WebServer) FieldUtils.readField(webServerField, drillbit, true); webServerTempDirPath = webServerHandle.getOrCreateTmpJavaScriptDir(); } catch (IllegalAccessException e) { e.printStackTrace(); } return webServerTempDirPath; }

Target:
private static File getWebServerTempDirPath(Drillbit drillbit) throws IllegalAccessException { Field webServerField = FieldUtils.getField(drillbit.getClass(), "webServer", true); WebServer webServerHandle = (WebServer) FieldUtils.readField(webServerField, drillbit, true); File webServerTempDirPath = webServerHandle.getOrCreateTmpJavaScriptDir(); return webServerTempDirPath; }
Source:
private Map<String, String> makeParserFields() { Map<String, String> fieldMapping = Maps.newHashMap(); for (final SchemaPath sp : getColumns()) { String drillField = sp.getRootSegment().getPath(); try { String parserField = HttpdParser.parserFormattedFieldName(drillField); fieldMapping.put(drillField, parserField); } catch (Exception e) { LOG.info("Putting field: " + drillField + " into map", e); } } return fieldMapping; }

Target:
private Map<String, String> makeParserFields() { Map<String, String> fieldMapping = new HashMap<>(); for (final SchemaPath sp : getColumns()) { String drillField = sp.getRootSegment().getPath(); try { String parserField = HttpdParser.parserFormattedFieldName(drillField); fieldMapping.put(drillField, parserField); } catch (Exception e) { LOG.info("Putting field: " + drillField + " into map", e); } } return fieldMapping; }
Source:
public void close() throws Exception { AutoCloseables.close(this.reader, this.fsStream); }

Target:
public void close() throws Exception { AutoCloseables.close(reader, fsStream); }
Source:
public static List<SchemaPath> projectAllWithMetadata(int dirCount) { return RowSetTestUtils.concat( RowSetTestUtils.projectAll(), expandMetadata(2)); }

Target:
public static List<SchemaPath> projectAllWithMetadata(int dirCount) { return RowSetTestUtils.concat( RowSetTestUtils.projectAll(), expandMetadata(dirCount)); }
Source:
public void transferTo(UntypedNullVector target) { target.valueCount = valueCount; }

Target:
public void transferTo(UntypedNullVector target) { target.valueCount = valueCount; clear(); }
Source:
public boolean isAutoLimitEnabled() { return autoLimitRowCount != null && autoLimitRowCount > 0; }

Target:
public boolean isAutoLimitEnabled() { return autoLimitRowCount > 0; }
Source:
public QueryWrapper(@JsonProperty("query") String query, @JsonProperty("queryType") String queryType, @JsonProperty("autoLimit") String autoLimit) { this.query = query; this.queryType = queryType.toUpperCase(); this.autoLimitRowCount = autoLimit != null && autoLimit.matches("[0-9]+") ? new Integer(autoLimit) : null; }

Target:
public QueryWrapper(@JsonProperty("query") String query, @JsonProperty("queryType") String queryType, @JsonProperty("autoLimit") String autoLimit) { this.query = query; this.queryType = queryType.toUpperCase(); this.autoLimitRowCount = autoLimit != null && autoLimit.matches("[0-9]+") ? Integer.valueOf(autoLimit) : 0; }
Source:
public static void stopMysql() { mysqld.stop(); }

Target:
public static void stopMysql() { if (mysqld != null) { mysqld.stop(); } }
Source:
public void appendMillis(final long p, Map<String, String> attributeMap) { //Embedding dataTable's data-order attribute if (attributeMap == null) { attributeMap = new HashMap<String, String>(); } attributeMap.put(HtmlAttribute.DATA_ORDER, String.valueOf(p)); appendCell((new SimpleDurationFormat(0, p)).compact(), NO_BGCOLOR, attributeMap); }

Target:
public void appendMillis(final long p, Map<String, String> attributeMap) { //Embedding dataTable's data-order attribute if (attributeMap == null) { attributeMap = new HashMap<>(); } attributeMap.put(HtmlAttribute.DATA_ORDER, String.valueOf(p)); appendCell((new SimpleDurationFormat(0, p)).compact(), NO_BGCOLOR, attributeMap); }
Source:
public void showSchemas() throws Exception { test("USE " + MINI_DFS_STORAGE_PLUGIN_NAME); testBuilder() .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") .unOrdered() .baselineColumns("SCHEMA_NAME") .baselineValues("hive.db_general") .baselineValues("hive.default") .go(); }

Target:
public void showSchemas() throws Exception { testBuilder() .sqlQuery("SHOW SCHEMAS LIKE 'hive.%'") .unOrdered() .baselineColumns("SCHEMA_NAME") .baselineValues("hive.db_general") .baselineValues("hive.default") .go(); }
Source:
public static List<FileStatus> listDirectoriesSafe(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) { List<FileStatus> statuses = new ArrayList<>(); try { listDirectories(fs, path, recursive, false, statuses, mergeFilters(filters)); } catch (Exception e) { // all exceptions are ignored } return statuses; }

Target:
public static List<FileStatus> listDirectoriesSafe(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) { List<FileStatus> statuses = new ArrayList<>(); try { listDirectories(fs, path, recursive, true, statuses, mergeFilters(filters)); } catch (Exception e) { // all exceptions are ignored } return statuses; }
Source:
public ParquetReadOptions toReadOptions() { return ParquetReadOptions.builder() .withMetadataFilter(NO_FILTER) .useSignedStringMinMax(enableStringsSignedMinMax) .build(); }

Target:
public ParquetReadOptions toReadOptions() { return ParquetReadOptions.builder() .useSignedStringMinMax(enableStringsSignedMinMax) .build(); }
Source:
public DrillSemiJoinRel( RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys) { super(cluster, traitSet, left, right, condition, leftKeys, rightKeys); Preconditions.checkArgument(validateTraits(traitSet, left, right)); }

Target:
public DrillSemiJoinRel( RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys) { super(cluster, traitSet, left, right, condition, leftKeys, rightKeys); }
Source:
public void addRuntimeFilter(RuntimeFilterWritable runtimeFilter) { this.runtimeFilterSink.aggregate(runtimeFilter); }

Target:
public void addRuntimeFilter(RuntimeFilterWritable runtimeFilter) { }
Source:
public RawFragmentBatch poll(long timeout, TimeUnit timeUnit) throws InterruptedException, IOException { RawFragmentBatchWrapper batchWrapper = buffer.poll(timeout, timeUnit); if (batchWrapper != null) { try { return batchWrapper.get(); } catch (InterruptedException e) { return null; } } return null; }

Target:
public RawFragmentBatch poll(long timeout, TimeUnit timeUnit) throws InterruptedException, IOException { RawFragmentBatchWrapper batchWrapper = buffer.poll(timeout, timeUnit); if (batchWrapper != null) { return batchWrapper.get(); } return null; }
Source:
public boolean isIntersectIndex() { if (indexProps.size() > 1) { return true; } else { return false; } }

Target:
public boolean isIntersectIndex() { return indexProps.size() > 1; }
Source:
public void testSimpleNoRowKeyJoin() throws Exception { String query = "SELECT `reverseid` from table(hbase.`index_test_primary`(type => 'maprdb', index => 'hash_i_reverseid')) " + "where `reverseid` = 1234"; test(defaultHavingIndexPlan); PlanTestBase.testPlanMatchingPatterns(query, new String[] {".*JsonTableGroupScan.*tableName=.*index_test_primary.*indexName=hash_i_reverseid"}, new String[]{"RowKeyJoin"} ); return; }

Target:
public void testSimpleNoRowKeyJoin() throws Exception { String query = "SELECT `reverseid` from table(hbase.`index_test_primary`(type => 'maprdb', index => 'hash_i_reverseid')) " + "where `reverseid` = 1234"; test(defaultHavingIndexPlan); PlanTestBase.testPlanMatchingPatterns(query, new String[] {".*JsonTableGroupScan.*tableName=.*index_test_primary.*indexName=hash_i_reverseid"}, new String[]{"RowKeyJoin"} ); }
Source:
public void NonCoveringPlan() throws Exception { String query = "SELECT t.`name`.`fname` AS `fname` FROM hbase.`index_test_primary` as t " + " where t.id.ssn = '100007423'"; test(defaultHavingIndexPlan); PlanTestBase.testPlanMatchingPatterns(query, new String[] {"RowKeyJoin", ".*RestrictedJsonTableGroupScan.*tableName=.*index_test_primary,", ".*JsonTableGroupScan.*tableName=.*index_test_primary,.*indexName=i_ssn"}, new String[]{} ); System.out.println("Non-Covering Plan Verified!"); testBuilder() .sqlQuery(query) .ordered() .baselineColumns("fname").baselineValues("KfFzK") .go(); return; }

Target:
public void NonCoveringPlan() throws Exception { String query = "SELECT t.`name`.`fname` AS `fname` FROM hbase.`index_test_primary` as t " + " where t.id.ssn = '100007423'"; test(defaultHavingIndexPlan); PlanTestBase.testPlanMatchingPatterns(query, new String[] {"RowKeyJoin", ".*RestrictedJsonTableGroupScan.*tableName=.*index_test_primary,", ".*JsonTableGroupScan.*tableName=.*index_test_primary,.*indexName=i_ssn"}, new String[]{} ); testBuilder() .sqlQuery(query) .ordered() .baselineColumns("fname").baselineValues("KfFzK") .go(); }
Source:
public MockStorageEngineConfig(@JsonProperty("url") String url) { this.url = url; this.setEnabled(true); }

Target:
public MockStorageEngineConfig(@JsonProperty("url") String url) { this.url = url; }
Source:
public static void setup() throws Exception { startCluster(ClusterFixture.builder(dirTestWatcher)); StoragePluginRegistry pluginRegistry = cluster.drillbit().getContext().getStorage(); FileSystemConfig pluginConfig = (FileSystemConfig) pluginRegistry.getPlugin(CP_PLUGIN_NAME).getConfig(); pluginConfig.setEnabled(false); pluginRegistry.createOrUpdate(CP_PLUGIN_NAME, pluginConfig, true); }

Target:
public static void setup() throws Exception { startCluster(ClusterFixture.builder(dirTestWatcher)); pluginRegistry = cluster.drillbit().getContext().getStorage(); pluginConfig = (FileSystemConfig) pluginRegistry.getPlugin(CP_PLUGIN_NAME).getConfig(); pluginConfig.setEnabled(false); pluginRegistry.createOrUpdate(CP_PLUGIN_NAME, pluginConfig, true); }
Source:
public void registerRuntimeFilter(RuntimeFilterWritable runtimeFilterWritable) { BitData.RuntimeFilterBDef runtimeFilterB = runtimeFilterWritable.getRuntimeFilterBDef(); int majorId = runtimeFilterB.getMajorFragmentId(); UserBitShared.QueryId queryId = runtimeFilterB.getQueryId(); List<String> probeFields = runtimeFilterB.getProbeFieldsList(); logger.info("RuntimeFilterRouter receives a runtime filter , majorId:{}, queryId:{}", majorId, QueryIdHelper.getQueryId(queryId)); broadcastAggregatedRuntimeFilter(majorId, queryId, probeFields, runtimeFilterWritable.getData()); }

Target:
public void registerRuntimeFilter(RuntimeFilterWritable runtimeFilterWritable) { broadcastAggregatedRuntimeFilter(runtimeFilterWritable); }
Source:
public boolean equals(Object other) { if (other instanceof RuntimeFilterWritable) { RuntimeFilterWritable otherRFW = (RuntimeFilterWritable) other; return this.identifier.equals(otherRFW.identifier); } return false; }

Target:
public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof RuntimeFilterWritable) { RuntimeFilterWritable otherRFW = (RuntimeFilterWritable) other; return this.identifier.equals(otherRFW.identifier); } return false; }
Source:
public void testAllMethods() { for (Method method : jdbcIntf.getMethods()) { if (method.isDefault()) { // Skip new default methods from java 10 continue; } testOneMethod(method); } }

Target:
public void testAllMethods() { for (Method method : jdbcIntf.getMethods()) { testOneMethod(method); } }
Source:
private JDKClassCompiler(JavaCompiler compiler, ClassLoader classLoader, boolean debug) { super(debug); this.compiler = compiler; this.listener = new DrillDiagnosticListener(); this.fileManager = new DrillJavaFileManager(compiler.getStandardFileManager(listener, null, Charsets.UTF_8), classLoader); this.compilerOptions = Lists.newArrayList("-source", "1.8", "-target", "1.8", this.debug ? "-g:source,lines,vars" : "-g:none"); }

Target:
private JDKClassCompiler(JavaCompiler compiler, ClassLoader classLoader, boolean debug) { super(debug); this.compiler = compiler; this.listener = new DrillDiagnosticListener(); this.fileManager = new DrillJavaFileManager(compiler.getStandardFileManager(listener, null, Charsets.UTF_8), classLoader); this.compilerOptions = Lists.newArrayList(this.debug ? "-g:source,lines,vars" : "-g:none"); }
Source:
private NullableIntVector createMissingColumn(SchemaPath col, OutputMutator output) throws SchemaChangeException { // col.toExpr() is used here as field name since we don't want to see these fields in the existing maps MaterializedField field = MaterializedField.create(col.toExpr().replace('`',' ').trim(), Types.optional(TypeProtos.MinorType.INT)); return (NullableIntVector) output.addField(field, TypeHelper.getValueVectorClass(TypeProtos.MinorType.INT, DataMode.OPTIONAL)); }

Target:
private NullableIntVector createMissingColumn(SchemaPath col, OutputMutator output) throws SchemaChangeException { // col.toExpr() is used here as field name since we don't want to see these fields in the existing maps MaterializedField field = MaterializedField.create(col.toExpr(), Types.optional(TypeProtos.MinorType.INT)); return (NullableIntVector) output.addField(field, TypeHelper.getValueVectorClass(TypeProtos.MinorType.INT, DataMode.OPTIONAL)); }
Source:
public Double getValue() { if (osMXBean != null) { return osMXBean.getSystemLoadAverage(); } return null; }

Target:
public Double getValue() { return (osMXBean != null) ? osMXBean.getSystemLoadAverage() : null; }
Source:
public LateralJoinPrel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, boolean excludeCorrelateCol, CorrelationId correlationId, ImmutableBitSet requiredColumns, SemiJoinType semiJoinType) { super(cluster, traits, left, right, excludeCorrelateCol, correlationId, requiredColumns, semiJoinType); }

Target:
protected LateralJoinPrel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, boolean excludeCorrelateCol, CorrelationId correlationId, ImmutableBitSet requiredColumns, SemiJoinType semiJoinType) { super(cluster, traits, left, right, excludeCorrelateCol, correlationId, requiredColumns, semiJoinType); }
Source:
public LimitPrel(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexNode offset, RexNode fetch, boolean pushDown, boolean isPartitioned) { super(cluster, traitSet, child, offset, fetch, pushDown); this.isParitioned = isPartitioned; }

Target:
public LimitPrel(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexNode offset, RexNode fetch, boolean pushDown, boolean isPartitioned) { super(cluster, traitSet, child, offset, fetch, pushDown); this.isPartitioned = isPartitioned; }
Source:
public Iterator<Entry<String, V>> getRange(int skip, int take) { Iterable<Entry<String, V>> entries = () -> new Iter(take); return StreamSupport.stream(entries.spliterator(), false) .skip(skip) .limit(take) .iterator(); }

Target:
public Iterator<Entry<String, V>> getRange(int skip, int take) { return new Iter(skip, take); }
Source:
private static void checkThatQueryIsNotOptimized(final String query) throws Exception { PlanTestBase.testPlanMatchingPatterns(wrapLimit0(query), new String[]{}, new String[]{ ".*Limit\\(offset=\\[0\\], fetch=\\[0\\]\\)(.*[\n\r])+.*Scan.*" }); }

Target:
private static void checkThatQueryIsNotOptimized(final String query) throws Exception { PlanTestBase.testPlanMatchingPatterns(wrapLimit0(query), null, new String[] {".*Limit\\(offset=\\[0\\], fetch=\\[0\\]\\)(.*[\n\r])+.*Scan.*"}); }
Source:
private static void checkThatQueryIsOptimized(final String query) throws Exception { PlanTestBase.testPlanMatchingPatterns(wrapLimit0(query), new String[]{ ".*Limit\\(offset=\\[0\\], fetch=\\[0\\]\\)(.*[\n\r])+.*Scan.*" }, new String[]{}); }

Target:
private static void checkThatQueryIsOptimized(final String query) throws Exception { PlanTestBase.testPlanMatchingPatterns(wrapLimit0(query), new String[] {".*Limit\\(offset=\\[0\\], fetch=\\[0\\]\\)(.*[\n\r])+.*Scan.*"}); }
Source:
public static void setup() throws IOException { Configuration conf = new Configuration(); footer = ParquetFileReader.readFooter(conf, new Path(path)); assertNotNull("footer must be not null", footer); }

Target:
public static void setup() throws IOException { Configuration conf = new Configuration(); footer = ParquetFileReader.readFooter(conf, new Path(path)); }
Source:
public SqlNode validate(final SqlNode parsedNode) { try { return validator.validate(parsedNode); } catch (RuntimeException e) { UserException.Builder builder = UserException .validationError(e) .addContext("SQL Query", (String) null); if (isInnerQuery) { builder.message("Failure validating a view your query is dependent upon."); } throw builder.build(logger); } }

Target:
public SqlNode validate(final SqlNode parsedNode) { try { return validator.validate(parsedNode); } catch (RuntimeException e) { UserException.Builder builder = UserException .validationError(e); if (isInnerQuery) { builder.message("Failure validating a view your query is dependent upon."); } throw builder.build(logger); } }
Source:
public PhysicalOperator visitUnnest(final Unnest unnest, final Object obj) { return new org.apache.drill.exec.physical.config.UnnestPOP(null, unnest.getColumn()); }

Target:
public PhysicalOperator visitUnnest(final Unnest unnest, final Object obj) { return new UnnestPOP(null, unnest.getColumn()); }
Source:
private Map<Integer, Integer> buildMapWithoutCorrColumn(RelNode corr, int correlationIndex) { int index = 0; Map<Integer, Integer> result = new HashedMap(); for (int i=0;i<corr.getRowType().getFieldList().size();i++) { if (i == correlationIndex) { continue; } else { result.put(i, index++); } } return result; }

Target:
private Map<Integer, Integer> buildMapWithoutCorrColumn(RelNode corr, int correlationIndex) { int index = 0; Map<Integer, Integer> result = new HashMap(); for (int i=0;i<corr.getRowType().getFieldList().size();i++) { if (i == correlationIndex) { continue; } else { result.put(i, index++); } } return result; }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (name == null ? 0 : name.hashCode()); return result; }
Source:
public void aggregate(RuntimeFilterWritable runtimeFilterWritable) { List<BloomFilter> thisFilters = this.unwrap(); List<BloomFilter> otherFilters = runtimeFilterWritable.unwrap(); for (int i = 0; i < thisFilters.size(); i++) { BloomFilter thisOne = thisFilters.get(0); BloomFilter otherOne = otherFilters.get(0); thisOne.or(otherOne); } for (BloomFilter bloomFilter : otherFilters) { bloomFilter.getContent().clear(); } }

Target:
public void aggregate(RuntimeFilterWritable runtimeFilterWritable) { List<BloomFilter> thisFilters = this.unwrap(); List<BloomFilter> otherFilters = runtimeFilterWritable.unwrap(); for (int i = 0; i < thisFilters.size(); i++) { BloomFilter thisOne = thisFilters.get(i); BloomFilter otherOne = otherFilters.get(i); thisOne.or(otherOne); } for (BloomFilter bloomFilter : otherFilters) { bloomFilter.getContent().clear(); } }
Source:
public SelectionVectorMode getEncoding() { return SelectionVectorMode.TWO_BYTE; }

Target:
public SelectionVectorMode getEncoding() { return SelectionVectorMode.NONE; }
Source:
public BloomFilter(int ndv, double fpp, BufferAllocator bufferAllocator) { int numBytes = BloomFilter.optimalNumOfBytes(ndv, fpp); int size = BloomFilter.adjustByteSize(numBytes); this.byteBuf = bufferAllocator.buffer(size); this.numBytes = byteBuf.capacity(); this.byteBuf.writerIndex(numBytes); }

Target:
public BloomFilter(int ndv, double fpp, BufferAllocator bufferAllocator) { this(BloomFilter.optimalNumOfBytes(ndv, fpp), bufferAllocator); }
Source:
private int computeNextBatchHolderSize(int batchSize) { return Math.min(batchSize, Math.min(remainingCapacity, maxBatchHolderSize)); }

Target:
private int computeNextBatchHolderSize(int batchSize) { return Math.min(batchSize, remainingCapacity); }
Source:
int getBit(TestBitPattern pattern, int index) { if (pattern == TestBitPattern.RANDOM) { final int randomBit = (int) (Math.random() * 2); return randomBit; } return (pattern == TestBitPattern.ALTERNATING) ? (index % 2) : ((pattern == TestBitPattern.ONE) ? 1 : 0); }

Target:
int getBit(TestBitPattern pattern, int index) { if (pattern == TestBitPattern.RANDOM) { return (int) (Math.random() * 2); } return (pattern == TestBitPattern.ALTERNATING) ? (index % 2) : ((pattern == TestBitPattern.ONE) ? 1 : 0); }
Source:
public List<InputSplit> getInputSplits() { return inputSplits; }

Target:
public Collection<InputSplit> getInputSplits() { return inputSplits; }
Source:
private SchemaPath replaceOverriddenSchemaPath(Map<String, String> parameters, SchemaPath colNameSchemaPath) { String hiveColumnName = colNameSchemaPath.getRootSegmentPath(); if (hiveColumnName.equals(parameters.get(MAPRDB_COLUMN_ID))) { return SchemaPath.getSimplePath(ID_KEY); } else { return colNameSchemaPath; } }

Target:
private SchemaPath replaceOverriddenSchemaPath(Map<String, String> parameters, SchemaPath colNameSchemaPath) { String hiveColumnName = colNameSchemaPath.getRootSegmentPath(); return hiveColumnName != null && hiveColumnName.equals(parameters.get(MAPRDB_COLUMN_ID)) ? SchemaPath.getSimplePath(ID_KEY) : colNameSchemaPath; }
Source:
private String replaceOverriddenColumnId(Map<String, String> parameters, String colName) { return Objects.equals(colName, parameters.get(MAPRDB_COLUMN_ID)) ? ID_KEY : colName; }

Target:
private String replaceOverriddenColumnId(Map<String, String> parameters, String colName) { return colName != null && colName.equals(parameters.get(MAPRDB_COLUMN_ID)) ? ID_KEY : colName; }
Source:
public static boolean isDirectMemoryOOM(Throwable e) { if (e instanceof OutOfDirectMemoryError || e instanceof OutOfMemoryException) { // These are always direct memory errors return true; } if (e instanceof OutOfMemoryError) { return DIRECT_MEMORY_OOM_MESSAGE.equals(e.getMessage()); } else { return false; } }

Target:
public static boolean isDirectMemoryOOM(Throwable e) { if (e instanceof OutOfDirectMemoryError || e instanceof OutOfMemoryException) { // These are always direct memory errors return true; } return (e instanceof OutOfMemoryError) && DIRECT_MEMORY_OOM_MESSAGE.equals(e.getMessage()); }
Source:
public static QueryId getQueryIdFromString(final String queryId) { final UUID uuid = UUID.fromString(queryId); return QueryId.newBuilder().setPart1(uuid.getMostSignificantBits()).setPart2(uuid.getLeastSignificantBits()).setText(queryId).build(); }

Target:
public static QueryId getQueryIdFromString(final String queryId) { final UUID uuid = UUID.fromString(queryId); return QueryId.newBuilder().setPart1(uuid.getMostSignificantBits()).setPart2(uuid.getLeastSignificantBits()).build(); }
Source:
private boolean canRemoveExchange(MajorFragmentStat parentFrag, MajorFragmentStat childFrag) { return (childFrag.isSingular() && parentFrag.isSingular() && (!childFrag.isDistributionStrict() || !parentFrag.isDistributionStrict())) || parentFrag.isRightSideOfLateral(); }

Target:
private boolean canRemoveExchange(MajorFragmentStat parentFrag, MajorFragmentStat childFrag) { if (childFrag.isSingular() && parentFrag.isSingular() && (!childFrag.isDistributionStrict() || !parentFrag.isDistributionStrict())) { return true; } if (parentFrag.isRightSideOfLateral()) { return true; } return false; }
Source:
public void mergeScanSpec(String functionName, KafkaPartitionScanSpec scanSpec) { switch (functionName) { case "booleanAnd": //Reduce the scan range if(startOffset < scanSpec.startOffset) { startOffset = scanSpec.startOffset; } if(endOffset > scanSpec.endOffset) { endOffset = scanSpec.endOffset; } break; case "booleanOr": //Increase the scan range if(scanSpec.startOffset < startOffset) { startOffset = scanSpec.startOffset; } if(scanSpec.endOffset > endOffset) { endOffset = scanSpec.endOffset; } break; default: assert(false); } }

Target:
public void mergeScanSpec(String functionName, KafkaPartitionScanSpec scanSpec) { switch (functionName) { case "booleanAnd": //Reduce the scan range if(startOffset < scanSpec.startOffset) { startOffset = scanSpec.startOffset; } if(endOffset > scanSpec.endOffset) { endOffset = scanSpec.endOffset; } break; case "booleanOr": //Increase the scan range if(scanSpec.startOffset < startOffset) { startOffset = scanSpec.startOffset; } if(scanSpec.endOffset > endOffset) { endOffset = scanSpec.endOffset; } break; } }
Source:
public Set<String> getTableNames() { if (tables == null) { try { tables = Sets.newHashSet(mClient.getTableNames(this.name, schemaConfig.getIgnoreAuthErrors())); } catch (final TException e) { logger.warn("Failure while attempting to access HiveDatabase '{}'.", this.name, e.getCause()); tables = new HashSet<>(); // empty set. } } return tables; }

Target:
public Set<String> getTableNames() { if (tables == null) { try { tables = Sets.newHashSet(mClient.getTableNames(this.name, schemaConfig.getIgnoreAuthErrors())); } catch (final TException e) { logger.warn("Failure while attempting to access HiveDatabase '{}'.", this.name, e.getCause()); tables = Sets.newHashSet(); // empty set. } } return tables; }
Source:
AbstractFieldReader() { super(); }

Target:
AbstractFieldReader() { }
Source:
private NullReader() { super(); type = Types.NULL; }

Target:
private NullReader() { type = Types.NULL; }
Source:
public void allocateVectors(VectorContainer container) { // Allocate memory for the vectors. // This will iteratively allocate memory for all nested columns underneath. for (VectorWrapper w : container) { RecordBatchSizer.ColumnSize colSize = getColumnSize(w.getField().getName()); colSize.allocateVector(w.getValueVector(), outputRowCount); } }

Target:
public void allocateVectors(VectorContainer container) { allocateVectors(container, outputRowCount); }
Source:
@Override public final void setup(FragmentContext context, RecordBatch incoming, RecordBatch outgoing, List<TransferPair> transfers, LateralContract lateral) throws SchemaChangeException { this.svMode = incoming.getSchema().getSelectionVectorMode(); switch (svMode) { case FOUR_BYTE: throw new UnsupportedOperationException("Unnest does not support selection vector inputs."); case TWO_BYTE: throw new UnsupportedOperationException("Unnest does not support selection vector inputs."); } this.transfers = ImmutableList.copyOf(transfers); this.lateral = lateral; }

Target:
public final void setup(FragmentContext context, RecordBatch incoming, RecordBatch outgoing, List<TransferPair> transfers, LateralContract lateral) throws SchemaChangeException { this.svMode = incoming.getSchema().getSelectionVectorMode(); if (svMode == NONE) { this.transfers = ImmutableList.copyOf(transfers); this.lateral = lateral; } else { throw new UnsupportedOperationException("Unnest does not support selection vector inputs."); } }
Source:
public void testFilterPushDownForExternalTable() throws Exception { String query = "select * from hive.kv_native_ext where key = 1"; int actualRowCount = testSql(query); assertEquals("Expected and actual row count should match", 1, actualRowCount); testPlanMatchingPatterns(query, new String[]{"HiveDrillNativeParquetScan", "numFiles=1"}, new String[]{}); }

Target:
public void testFilterPushDownForExternalTable() throws Exception { String query = "select * from hive.kv_native_ext where key = 1"; int actualRowCount = testSql(query); assertEquals("Expected and actual row count should match", 1, actualRowCount); testPlanMatchingPatterns(query, new String[]{"HiveDrillNativeParquetScan", "numFiles=1"}, null); }
Source:
public void flushOutgoingBatches(boolean isLastBatch, boolean schemaChanged) throws IOException, InterruptedException { for (OutgoingRecordBatch batch : outgoingBatches) { if (Thread.interrupted()) { throw new InterruptedException(); } logger.debug("Attempting to flush all outgoing batches"); if (isLastBatch) { batch.setIsLast(); } batch.flush(schemaChanged); if (schemaChanged) { batch.resetBatch(); batch.initializeBatch(); } } }

Target:
public void flushOutgoingBatches(boolean isLastBatch, boolean schemaChanged) throws IOException { for (OutgoingRecordBatch batch : outgoingBatches) { logger.debug("Attempting to flush all outgoing batches"); if (isLastBatch) { batch.setIsLast(); } batch.flush(schemaChanged); if (schemaChanged) { batch.resetBatch(); batch.initializeBatch(); } } }
Source:
public boolean isRunning() { if (embeddedJetty == null || embeddedJetty.getConnectors().length != 1) { return false; } return true; }

Target:
public boolean isRunning() { return (embeddedJetty != null && embeddedJetty.getConnectors().length == 1); }