Add back function signature for compat (#13914)

* Add back function signature for compat

* Suppress IntelliJ Error
This commit is contained in:
imply-cheddar 2023-03-10 14:06:34 +09:00 committed by GitHub
parent c16d9da35a
commit 6b90a320cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 0 deletions

View File

@ -42,6 +42,7 @@ import java.util.function.Function;
*/ */
public class MaxSizeSplitHintSpec implements SplitHintSpec public class MaxSizeSplitHintSpec implements SplitHintSpec
{ {
@SuppressWarnings("unused")
public static final String TYPE = "maxSize"; public static final String TYPE = "maxSize";
@VisibleForTesting @VisibleForTesting

View File

@ -40,6 +40,7 @@ import java.util.function.Function;
*/ */
public class SegmentsSplitHintSpec implements SplitHintSpec public class SegmentsSplitHintSpec implements SplitHintSpec
{ {
@SuppressWarnings("unused")
public static final String TYPE = "segments"; public static final String TYPE = "segments";
private static final HumanReadableBytes DEFAULT_MAX_INPUT_SEGMENT_BYTES_PER_TASK = new HumanReadableBytes("1GiB"); private static final HumanReadableBytes DEFAULT_MAX_INPUT_SEGMENT_BYTES_PER_TASK = new HumanReadableBytes("1GiB");

View File

@ -21,6 +21,7 @@ package org.apache.druid.sql.calcite.expression;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import org.apache.calcite.jdbc.JavaTypeFactoryImpl;
import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.core.Project;
import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.calcite.rex.RexCall; import org.apache.calcite.rex.RexCall;
@ -80,6 +81,30 @@ public class Expressions
// No instantiation. // No instantiation.
} }
/**
* Old method used to translate a field access, possibly through a projection, to an underlying Druid dataSource.
*
* This exists to provide API compatibility to extensions, but is deprecated because there is a 4 argument version
* that should be used instead. Call sites should have access to a RexBuilder instance that they can get the
* typeFactory from.
*
* @param rowSignature row signature of underlying Druid dataSource
* @param project projection, or null
* @param fieldNumber number of the field to access
*
* @return row expression
*/
@Deprecated
public static RexNode fromFieldAccess(
final RowSignature rowSignature,
@Nullable final Project project,
final int fieldNumber
)
{
//noinspection VariableNotUsedInsideIf
return fromFieldAccess(project == null ? new JavaTypeFactoryImpl() : null, rowSignature, project, fieldNumber);
}
/** /**
* Translate a field access, possibly through a projection, to an underlying Druid dataSource. * Translate a field access, possibly through a projection, to an underlying Druid dataSource.
* *