name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
flink_CustomHeadersDecorator_setCustomHeaders_rdh | /**
* Sets the custom headers for the message.
*
* @param customHeaders
* A collection of custom headers.
*/
public void setCustomHeaders(Collection<HttpHeader> customHeaders) {
this.customHeaders = customHeaders;
} | 3.26 |
flink_RawFormatSerializationSchema_createNotNullConverter_rdh | /**
* Creates a runtime converter.
*/
private SerializationRuntimeConverter createNotNullConverter(LogicalType type,
String charsetName, boolean isBigEndian) {
switch (type.getTypeRoot()) {
case CHAR :
case VARCHAR
:
return createStringConverter(charsetName);
... | 3.26 |
flink_RawFormatSerializationSchema_createConverter_rdh | /**
* Creates a runtime converter.
*/
private SerializationRuntimeConverter createConverter(LogicalType type, String charsetName, boolean isBigEndian) {
final SerializationRuntimeConverter converter = createNotNullConverter(type, charsetName, isBigEndian);
return new SerializationRuntimeConverter()
{
... | 3.26 |
flink_HeapReducingState_mergeState_rdh | // ------------------------------------------------------------------------
// state merging
// ------------------------------------------------------------------------
@Override
protected V mergeState(V a, V b) throws Exception {
return reduceTransformation.apply(a, b);
} | 3.26 |
flink_HeapReducingState_get_rdh | // state access
// ------------------------------------------------------------------------
@Override
public V get() {
return getInternal();
} | 3.26 |
flink_DataStreamAllroundTestProgram_m0_rdh | /**
* A general purpose test job for Flink's DataStream API operators and primitives.
*
* <p>The job is constructed of generic components from {@link DataStreamAllroundTestJobFactory}. It
* currently covers the following aspects that are frequently present in Flink DataStream jobs:
*
* <ul>
* <li>A generic Kry... | 3.26 |
flink_DecimalBigDecimalConverter_create_rdh | // --------------------------------------------------------------------------------------------
// Factory method
// --------------------------------------------------------------------------------------------
static DecimalBigDecimalConverter create(DataType dataType) {
final DecimalType
decimalType = ((Decima... | 3.26 |
flink_PatternProcessFunctionBuilder_fromFlatSelect_rdh | /**
* Starts constructing a {@link PatternProcessFunction} from a {@link PatternFlatSelectFunction}
* that emitted elements through {@link org.apache.flink.util.Collector}.
*/
static <IN, OUT> FlatSelectBuilder<IN, OUT> fromFlatSelect(final PatternFlatSelectFunction<IN, OUT> function) {
return new FlatSelectBui... | 3.26 |
flink_PatternProcessFunctionBuilder_fromSelect_rdh | /**
* Starts constructing a {@link PatternProcessFunction} from a {@link PatternSelectFunction}
* that emitted elements through return value.
*/
static <IN, OUT> SelectBuilder<IN, OUT> fromSelect(final PatternSelectFunction<IN, OUT> function) {
return new SelectBuilder<>(function);
} | 3.26 |
flink_ScheduledDropwizardReporter_open_rdh | // ------------------------------------------------------------------------
// life cycle
// ------------------------------------------------------------------------
@Override
public void open(MetricConfig config) {
this.reporter = getReporter(config);
} | 3.26 |
flink_ScheduledDropwizardReporter_getCounters_rdh | // ------------------------------------------------------------------------
// Getters
// ------------------------------------------------------------------------
@VisibleForTesting
Map<Counter, String> getCounters() {
return counters;
} | 3.26 |
flink_ScheduledDropwizardReporter_notifyOfAddedMetric_rdh | // ------------------------------------------------------------------------
// adding / removing metrics
// ------------------------------------------------------------------------
@Override
public void notifyOfAddedMetric(Metric metric, String
metricName, MetricGroup group) {
final St... | 3.26 |
flink_ScheduledDropwizardReporter_report_rdh | // ------------------------------------------------------------------------
// scheduled reporting
// ------------------------------------------------------------------------
@Override
public void report() {
// we do not need to lock here, because the dropwizard registry is
// internally a concurrent map
@SuppressWarni... | 3.26 |
flink_AsyncLookupFunction_eval_rdh | /**
* Invokes {@link #asyncLookup} and chains futures.
*/
public final void eval(CompletableFuture<Collection<RowData>> future, Object... keys) {
GenericRowData keyRow = GenericRowData.of(keys);
asyncLookup(keyRow).whenComplete((result, exception) -> {
if (exception != null) {
future.co... | 3.26 |
flink_HiveParserUtils_getGenericUDAFInfo_rdh | /**
* Returns the GenericUDAFInfo struct for the aggregation.
*/
public static GenericUDAFInfo getGenericUDAFInfo(GenericUDAFEvaluator evaluator, GenericUDAFEvaluator.Mode emode, ArrayList<ExprNodeDesc> aggParameters) throws SemanticException {
GenericUDAFInfo res = new GenericUDAFInfo();
// set r.genericUDAFEvaluat... | 3.26 |
flink_HiveParserUtils_toImmutableList_rdh | // converts a collection to guava ImmutableList
private static Object toImmutableList(Collection collection) {
try {
Class clz = (useShadedImmutableList) ? shadedImmutableListClz : immutableListClz;
return HiveReflectionUtils.invokeMethod(clz, null, "copyOf", new Class[]{ Collection.class }, new Obj... | 3.26 |
flink_HiveParserUtils_toRelDataType_rdh | // converts a hive TypeInfo to RelDataType
public static RelDataType toRelDataType(TypeInfo typeInfo, RelDataTypeFactory relTypeFactory) throws SemanticException {
RelDataType res;
switch (typeInfo.getCategory()) {
case PRIMITIVE :
// hive sets NULLABLE for all primitive types, revert that
... | 3.26 |
flink_HiveParserUtils_isNative_rdh | // TODO: we need a way to tell whether a function is built-in, for now just return false so that
// the unparser will quote them
public static boolean isNative(SqlOperator sqlOperator) {
return false;
} | 3.26 |
flink_HiveParserUtils_getWritableObjectInspector_rdh | /**
* Convert exprNodeDesc array to ObjectInspector array.
*/
public static ArrayList<ObjectInspector> getWritableObjectInspector(ArrayList<ExprNodeDesc> exprs) {
ArrayList<ObjectInspector> result = new ArrayList<>();
for (ExprNodeDesc expr
: exprs) {
result.add(expr.getWritableObjectInspector());
}
return result;
} | 3.26 |
flink_HiveParserUtils_isValuesTempTable_rdh | /**
* Check if the table is the temporary table created by VALUES() syntax.
*
* @param tableName
* table name
*/
public static boolean isValuesTempTable(String tableName) {
return tableName.toLowerCase().startsWith(HiveParserSemanticAnalyzer.VALUES_TMP_TABLE_NAME_PREFIX.toLowerCase());
} | 3.26 |
flink_HiveParserUtils_createAggregateCall_rdh | /**
* Counterpart of org.apache.calcite.rel.core.AggregateCall#create. It uses
* HiveParserOperatorBinding as SqlOperatorBinding to create AggregateCall instead, which
* enables to get literal value for operand.
*/
private static AggregateCall createAggregateCall(SqlAggFunction aggFunction,
boolean distinct, boolea... | 3.26 |
flink_HiveParserUtils_writeAsText_rdh | /**
* Convert a string to Text format and write its bytes in the same way TextOutputFormat would
* do. This is needed to properly encode non-ascii characters.
*/
public static void writeAsText(String text, FSDataOutputStream out) throws IOException {
Text to = new Text(text);
out.write(to.getBytes(), 0,
... | 3.26 |
flink_HiveParserUtils_projectNonColumnEquiConditions_rdh | /**
* Push any equi join conditions that are not column references as Projections on top of the
* children.
*/
public static RexNode projectNonColumnEquiConditions(RelFactories.ProjectFactory factory, RelNode[] inputRels, List<RexNode> leftJoinKeys, List<RexNode> rightJoinKeys, int systemColCount, List<Integer> left... | 3.26 |
flink_HiveParserUtils_canHandleQbForCbo_rdh | // Overrides CalcitePlanner::canHandleQbForCbo to support SORT BY, CLUSTER BY, etc.
public static String canHandleQbForCbo(QueryProperties queryProperties) {
if (!queryProperties.hasPTF())
{return null;
}
String msg = "";
if (queryProperties.hasPTF()) {
msg += "has PTF; ";
}
return m... | 3.26 |
flink_HiveParserUtils_toImmutableSet_rdh | // converts a collection to guava ImmutableSet
private static Object toImmutableSet(Collection collection) {
try {
Class clz = (useShadedImmutableSet) ? shadedImmutableSetClz : immutableSetClz;
return HiveReflectionUtils.invokeMethod(clz, null, "copyOf", new Class[]{ Collection.class }, new Object[... | 3.26 |
flink_HiveParserUtils_rexSubQueryIn_rdh | /**
* Proxy to {@link RexSubQuery#in(RelNode, com.google.common.collect.ImmutableList)}.
*/
public static RexSubQuery rexSubQueryIn(RelNode relNode, Collection<RexNode> rexNodes) {
Class[] argTypes = new Class[]{ RelNode.class, null };
argTypes[1] = (useShadedImmutableList) ? shadedImmutableListClz : immuta... | 3.26 |
flink_HiveParserUtils_genFilterRelNode_rdh | // creates LogicFilter node
public static RelNode genFilterRelNode(RelNode relNode, RexNode rexNode, Collection<CorrelationId> variables) { Class[] argTypes = new Class[]{ RelNode.class, RexNode.class, useShadedImmutableSet ? shadedImmutableSetClz : immutableSetClz };
Method method = HiveReflectionUtils.tryGetMetho... | 3.26 |
flink_HiveParserUtils_getFunctionInfo_rdh | // Get FunctionInfo and always look for it in metastore when FunctionRegistry returns null.
public static FunctionInfo getFunctionInfo(String funcName) throws SemanticException {
FunctionInfo res = FunctionRegistry.getFunctionInfo(funcName);
if (res == null)
{
SessionState sessionState = SessionState.get();
HiveConf hi... | 3.26 |
flink_HiveParserUtils_makeOver_rdh | /**
* Proxy to {@link RexBuilder#makeOver(RelDataType, SqlAggFunction, List, List,
* com.google.common.collect.ImmutableList, RexWindowBound, RexWindowBound, boolean, boolean,
* boolean, boolean, boolean)}.
*/
public static RexNode makeOver(RexBuilder rexBuilder, RelDataType type, SqlAggFunc... | 3.26 |
flink_HiveParserUtils_getGenericUDAFEvaluator_rdh | // Returns the GenericUDAFEvaluator for the aggregation. This is called once for each GroupBy
// aggregation.
// TODO: Requiring a GenericUDAFEvaluator means we only support hive UDAFs. Need to avoid this
// to support flink UDAFs.
public static GenericUDAFEvaluator getGenericUDAFEvaluator(String aggName, ArrayList<Exp... | 3.26 |
flink_HiveParserUtils_genValuesRelNode_rdh | // creates LogicalValues node
public static RelNode genValuesRelNode(RelOptCluster cluster, RelDataType rowType, List<List<RexLiteral>> rows) {
List<Object> immutableRows = rows.stream().map(HiveParserUtils::toImmutableList).collect(Collectors.toList());
Class[] argTypes = new Class[]{ RelOptCluster.class, RelD... | 3.26 |
flink_HiveParserUtils_isRegex_rdh | /**
* Returns whether the pattern is a regex expression (instead of a normal string). Normal string
* is a string with all alphabets/digits and "_".
*/
public static boolean
isRegex(String pattern, HiveConf conf) {String qIdSupport = HiveConf.getVar(conf, ConfVars.HIVE_QUOTEDID_SUPPORT);
if ("column".equals(qIdSup... | 3.26 |
flink_SessionManager_create_rdh | /**
* Create the {@link SessionManager} with the default configuration.
*/
static SessionManager
create(DefaultContext defaultContext) {
return new SessionManagerImpl(defaultContext);
} | 3.26 |
flink_FlinkJoinToMultiJoinRule_combinePostJoinFilters_rdh | /**
* Combines the post-join filters from the left and right inputs (if they are MultiJoinRels)
* into a single AND'd filter.
*
* @param joinRel
* the original LogicalJoin
* @param left
* left child of the LogicalJoin
* @param right
* right child of the LogicalJoin
* @return combined post-join filters A... | 3.26 |
flink_FlinkJoinToMultiJoinRule_combineJoinFilters_rdh | /**
* Combines the join filters from the left and right inputs (if they are MultiJoinRels) with the
* join filter in the joinrel into a single AND'd join filter, unless the inputs correspond to
* null generating inputs in an outer join.
*
* @param join
* Join
* @param left
* Left input of the join
* @param... | 3.26 |
flink_FlinkJoinToMultiJoinRule_matches_rdh | // ~ Methods ----------------------------------------------------------------
@Overridepublic boolean matches(RelOptRuleCall call) {
final Join origJoin = call.rel(0);
return
origJoin.getJoinType().projectsRight();
} | 3.26 |
flink_FlinkJoinToMultiJoinRule_combineOuterJoins_rdh | /**
* Combines the outer join conditions and join types from the left and right join inputs. If the
* join itself is either a left or right outer join, then the join condition corresponding to
* the join is also set in the position corresponding to the null-generating input into the
* join. The join type is also se... | 3.26 |
flink_FlinkJoinToMultiJoinRule_shiftRightFilter_rdh | /**
* Shifts a filter originating from the right child of the LogicalJoin to the right, to reflect
* the filter now being applied on the resulting MultiJoin.
*
* @param joinRel
* the original LogicalJoin
* @param left
* the left child of the LogicalJoin
* @param right
* the right child of the LogicalJoin... | 3.26 |
flink_FlinkJoinToMultiJoinRule_copyOuterJoinInfo_rdh | /**
* Copies outer join data from a source MultiJoin to a new set of arrays. Also adjusts the
* conditions to reflect the new position of an input if that input ends up being shifted to the
* right.
*
* @param multiJoin
* the source MultiJoin
* @param destJoinSpecs
* the list where the join types and condit... | 3.26 |
flink_FlinkJoinToMultiJoinRule_canCombine_rdh | /**
* Returns whether an input can be merged into a given relational expression without changing
* semantics.
*
* @param input
* input into a join
* @param nullGenerating
* true if the input is null generating
* @return true if the input can be combined into a parent MultiJoin
*/
private boolean canCombine... | 3.26 |
flink_FlinkJoinToMultiJoinRule_addOnJoinFieldRefCounts_rdh | /**
* Adds on to the existing join condition reference counts the references from the new join
* condition.
*
* @param multiJoinInputs
* inputs into the new MultiJoin
* @param nTotalFields
* total number of fields in the MultiJoin
* @param joinCondition
* the new join condition
* @param origJoinFieldRef... | 3.26 |
flink_FlinkJoinToMultiJoinRule_withOperandFor_rdh | /**
* Defines an operand tree for the given classes.
*/
default Config withOperandFor(Class<? extends Join> joinClass) {
return withOperandSupplier(b0 -> b0.operand(joinClass).inputs(b1 -> b1.operand(RelNode.class).anyInputs(), b2 -> b2.operand(RelNode.class).anyInputs())).as(FlinkJoinToMultiJoinRule.Config.class... | 3.26 |
flink_FlinkJoinToMultiJoinRule_combineInputs_rdh | /**
* Combines the inputs into a LogicalJoin into an array of inputs.
*
* @param join
* original join
* @param left
* left input into join
* @param right
* right input into join
* @param projFieldsList
* returns a list of the new combined projection fields
* @param joinFieldRefCountsList
* returns... | 3.26 |
flink_OutputTag_equals_rdh | // ------------------------------------------------------------------------
@Overridepublic boolean equals(Object obj) {
if
(obj == this) {
return true;
}
if ((obj == null) || (!(obj instanceof OutputTag))) {
return false;
}
OutputTag other = ((OutputTag) (obj));
return Objec... | 3.26 |
flink_OutputTag_getId_rdh | // ------------------------------------------------------------------------
public String getId()
{
return id;
} | 3.26 |
flink_Runnables_assertNoException_rdh | /**
* Utils related to {@link Runnable}.
*/public class Runnables {
/**
* Asserts that the given {@link Runnable} does not throw exceptions. If the runnable throws
* exceptions, then it will call the {@link FatalExitExceptionHandler}.
*
* @param runnable
* to assert for no exceptions
... | 3.26 |
flink_Runnables_withUncaughtExceptionHandler_rdh | /**
* Guard {@link Runnable} with uncaughtException handler, because {@link java.util.concurrent.ScheduledExecutorService} does not respect the one assigned to executing
* {@link Thread} instance.
*
* @param runnable
* Runnable future to guard.
* @param uncaughtExceptionHandler
* Handler to call in case of u... | 3.26 |
flink_DefaultOperatorStateBackend_getBroadcastState_rdh | // -------------------------------------------------------------------------------------------
// State access methods
// -------------------------------------------------------------------------------------------
@SuppressWarnings("unchecked")
@Override
public <K, V> BroadcastState<K, V> getBroadcastState(final MapSta... | 3.26 |
flink_DefaultOperatorStateBackend_snapshot_rdh | // -------------------------------------------------------------------------------------------
// Snapshot
// -------------------------------------------------------------------------------------------
@Nonnull
@Override
public RunnableFuture<SnapshotResult<OperatorStateHandle>> snapshot(long checkpointId, long timesta... | 3.26 |
flink_TaskStateManagerImpl_notifyCheckpointAborted_rdh | /**
* Tracking when some local state can be disposed.
*/
@Override
public void notifyCheckpointAborted(long checkpointId) {
localStateStore.abortCheckpoint(checkpointId);
} | 3.26 |
flink_TaskStateManagerImpl_notifyCheckpointComplete_rdh | /**
* Tracking when local state can be confirmed and disposed.
*/
@Override
public void notifyCheckpointComplete(long checkpointId) throws Exception {
localStateStore.confirmCheckpoint(checkpointId);
} | 3.26 |
flink_TopologyGraph_link_rdh | /**
* Link an edge from `from` node to `to` node if no loop will occur after adding this edge.
* Returns if this edge is successfully added.
*/
boolean link(ExecNode<?> from, ExecNode<?> to) {
TopologyNode fromNode = getOrCreateTopologyNode(from);
TopologyNode toNode = getOrCreateTopologyNode(to);
if (ca... | 3.26 |
flink_TopologyGraph_makeAsFarAs_rdh | /**
* Make the distance of node A at least as far as node B by adding edges from all inputs of node
* B to node A.
*/
void makeAsFarAs(ExecNode<?> a, ExecNode<?> b) {
TopologyNode nodeA = getOrCreateTopologyNode(a);
TopologyNode nodeB = getOrCreateTopologyNode(b);
for (TopologyNode input : nodeB.inputs... | 3.26 |
flink_TopologyGraph_m0_rdh | /**
* Remove the edge from `from` node to `to` node. If there is no edge between them then do
* nothing.
*/
void m0(ExecNode<?> from, ExecNode<?> to) {
TopologyNode fromNode
= getOrCreateTopologyNode(from);
TopologyNode toNode = getOrCreateTopologyNode(to);
fromNode.outputs.remove(toN... | 3.26 |
flink_TopologyGraph_calculateMaximumDistance_rdh | /**
* Calculate the maximum distance of the currently added nodes from the nodes without inputs.
* The smallest distance is 0 (which are exactly the nodes without inputs) and the distances of
* other nodes are the largest distances in their inputs plus 1.
*
* <p>Distance of a node is defined as the number of edges... | 3.26 |
flink_PathPattern_tokens_rdh | /**
* Returns the pattern given at the constructor, without slashes at both ends, and split by
* {@code '/'}.
*/
public String[] tokens() {
return tokens;
} | 3.26 |
flink_PathPattern_pattern_rdh | /**
* Returns the pattern given at the constructor, without slashes at both ends.
*/
public String pattern() {
return pattern;
} | 3.26 |
flink_PathPattern_match_rdh | // --------------------------------------------------------------------------
/**
* {@code params} will be updated with params embedded in the request path.
*
* <p>This method signature is designed so that {@code requestPathTokens} and {@code params} can
* be created only once then reused, t... | 3.26 |
flink_PathPattern_hashCode_rdh | // --------------------------------------------------------------------------
// Instances of this class can be conveniently used as Map keys.
@Override
public int hashCode() {
return pattern.hashCode();
} | 3.26 |
flink_MethodlessRouter_addRoute_rdh | /**
* This method does nothing if the path pattern has already been added. A path pattern can only
* point to one target.
*/public MethodlessRouter<T> addRoute(String pathPattern, T target) {PathPattern p = new
PathPattern(pathPattern);
if (routes.containsKey(p)) {
return this;}routes.put(p, targ... | 3.26 |
flink_MethodlessRouter_anyMatched_rdh | /**
* Checks if there's any matching route.
*/
public boolean anyMatched(String[] requestPathTokens) {
Map<String,
String> pathParams = new HashMap<>();
for (PathPattern pattern : routes.keySet()) {
if (pattern.match(requestPathTokens, pathParams)) {
return true;
}
// R... | 3.26 |
flink_MethodlessRouter_route_rdh | // --------------------------------------------------------------------------
/**
*
* @return {@code null} if no match
*/
public RouteResult<T> route(String uri, String decodedPath, Map<String,
List<String>> queryParameters, String[] pathTokens) {// Optimize: reuse requestPathTokens and pathParams in the loop
... | 3.26 |
flink_MethodlessRouter_removePathPattern_rdh | // --------------------------------------------------------------------------
/**
* Removes the route specified by the path pattern.
*/
public void removePathPattern(String pathPattern) {
PathPattern p = new PathPattern(pathPattern);
T target = routes.remove(p);
if (target == null) {
return;
}... | 3.26 |
flink_MethodlessRouter_routes_rdh | // --------------------------------------------------------------------------
/**
* Returns all routes in this router, an unmodifiable map of {@code PathPattern -> Target}.
*/
public Map<PathPattern, T> routes() {
return Collections.unmodifiableMap(routes);
} | 3.26 |
flink_BlockCompressionFactory_createBlockCompressionFactory_rdh | /**
* Creates {@link BlockCompressionFactory} according to the configuration.
*
* @param compressionFactoryName
* supported compression codecs or user-defined class name
* inherited from {@link BlockCompressionFactory}.
*/
static BlockCompressionFactory createBlockCompressionFa... | 3.26 |
flink_DoubleMinimum_add_rdh | // ------------------------------------------------------------------------
// Primitive Specializations
// ------------------------------------------------------------------------
public void add(double value) {
this.min = Math.min(this.min, value);
} | 3.26 |
flink_DoubleMinimum_toString_rdh | // ------------------------------------------------------------------------
// Utilities
// ------------------------------------------------------------------------
@Override
public String toString() {
return "DoubleMinimum " + this.min;
} | 3.26 |
flink_HiveStatsUtil_getFieldNames_rdh | /**
* Get field names from field schemas.
*/
private static Set<String> getFieldNames(List<FieldSchema> fieldSchemas) {
Set<String> names = new HashSet<>();
for (FieldSchema fs : fieldSchemas) {
names.add(fs.getName());
}
return names;
} | 3.26 |
flink_HiveStatsUtil_getPartialPartitionVals_rdh | /**
* Get the partial partition values whose {@param partitionColIndex} partition column value will
* be {@param defaultPartitionName} and the value for preceding partition column will empty
* string.
*
* <p>For example, if partitionColIndex = 3, defaultPartitionName = __default_partition__, the
* partial partiti... | 3.26 |
flink_HiveStatsUtil_getPartitionColumnStats_rdh | /**
* Get statistics for a specific partition column.
*
* @param logicalType
* the specific partition column's logical type
* @param partitionValue
* the partition value for the specific partition column
* @param partitionColIndex
* the index of the specific partition column
* @param defaultPartitionName... | 3.26 |
flink_HiveStatsUtil_updateStats_rdh | /**
* Update original table statistics parameters.
*
* @param newTableStats
* new catalog table statistics.
* @param parameters
* original hive table statistics parameters.
*/
public static void updateStats(CatalogTableStatistics newTableStats, Map<String, String> parameters) {
parameters.put(StatsSetu... | 3.26 |
flink_HiveStatsUtil_createTableColumnStats_rdh | /**
* Create Flink ColumnStats from Hive ColumnStatisticsData.
*/
private static CatalogColumnStatisticsDataBase createTableColumnStats(DataType colType, ColumnStatisticsData stats, String hiveVersion) {
HiveShim v51 = HiveShimLoader.loadHiveShim(hiveVersion);
if (stats.isSetBinaryStats()) {
BinaryCo... | 3.26 |
flink_HiveStatsUtil_createPartitionColumnStats_rdh | /**
* Create columnStatistics from the given Hive column stats of a hive partition.
*/
public static ColumnStatistics createPartitionColumnStats(Partition hivePartition, String partName, Map<String, CatalogColumnStatisticsDataBase> colStats, String hiveVersion) {
ColumnStatisticsDesc desc = new ColumnStatistics... | 3.26 |
flink_HiveStatsUtil_getPartitionColumnNullCount_rdh | /**
* Get the null count for the {@param partitionColIndex} partition column in table {@param hiveTable}.
*
* <p>To get the null count, it will first list all the partitions whose {@param partitionColIndex} partition column is null, and merge the partition's statistic to get the
* total rows, which is exactly null ... | 3.26 |
flink_HiveStatsUtil_createCatalogColumnStats_rdh | /**
* Create a map of Flink column stats from the given Hive column stats.
*/
public static Map<String, CatalogColumnStatisticsDataBase> createCatalogColumnStats(@Nonnull
List<ColumnStatisticsObj> hiveColStats, String hiveVersion) {
checkNotNull(hiveColStats, "hiveColStats can not be null");
Map<Str... | 3.26 |
flink_HiveStatsUtil_getCatalogPartitionColumnStats_rdh | /**
* Get column statistic for partition columns.
*/
public static Map<String, CatalogColumnStatisticsDataBase> getCatalogPartitionColumnStats(HiveMetastoreClientWrapper client, HiveShim hiveShim, Table hiveTable, String partitionName, List<FieldSchema> partitionColsSchema, String defaultPartitionName) {
Map<Stri... | 3.26 |
flink_HiveStatsUtil_tableStatsChanged_rdh | /**
* Determine whether the stats change.
*
* @param newStats
* the new table statistics parameters
* @param oldStats
* the old table statistics parameters
* @return whether the stats change
*/
public static boolean tableStatsChanged(Map<String, String> newStats, Map<String, String> oldStats) {return statsC... | 3.26 |
flink_HiveStatsUtil_getColumnStatisticsData_rdh | /**
* Convert Flink ColumnStats to Hive ColumnStatisticsData according to Hive column type. Note we
* currently assume that, in Flink, the max and min of ColumnStats will be same type as the
* Flink column type. For example, for SHORT and Long columns, the max and min of their
* ColumnStats should be of type SHORT ... | 3.26 |
flink_HiveStatsUtil_statsChanged_rdh | /**
* Determine whether the table statistics changes.
*
* @param newTableStats
* new catalog table statistics.
* @param parameters
* original hive table statistics parameters.
* @return whether the table statistics changes
*/
public static boolean statsChanged(CatalogTableStatistics newTableStats, Map<Strin... | 3.26 |
flink_BuiltInSqlOperator_unwrapVersion_rdh | // --------------------------------------------------------------------------------------------
static Optional<Integer> unwrapVersion(SqlOperator operator) {
if (operator instanceof BuiltInSqlOperator) {
final BuiltInSqlOperator
builtInSqlOperator = ((BuiltInSqlOperator) (operator));
return... | 3.26 |
flink_RecordCounter_of_rdh | /**
* Creates a {@link RecordCounter} depends on the index of count(*). If index is less than zero,
* returns {@link AccumulationRecordCounter}, otherwise, {@link RetractionRecordCounter}.
*
* @param indexOfCountStar
* The index of COUNT(*) in the aggregates. -1 when the input doesn't
* contain COUNT(*), i.e.... | 3.26 |
flink_InPlaceMutableHashTable_reset_rdh | /**
* Seeks to the beginning.
*/
public void reset()
{
seekOutput(segments.get(0), 0);
currentSegmentIndex = 0;
} | 3.26 |
flink_InPlaceMutableHashTable_m1_rdh | /**
* Sets appendPosition and the write position to 0, so that appending starts overwriting
* elements from the beginning. (This is used in rebuild.)
*
* <p>Note: if data was written to the area after the current appendPosition before a call
* to resetAppendPosition, it should still be readable. To release the seg... | 3.26 |
flink_InPlaceMutableHashTable_insertOrReplaceRecord_rdh | /**
* Searches the hash table for a record with the given key. If it is found, then it is
* overridden with the specified record. Otherwise, the specified record is inserted.
*
* @param record
* The record to insert or to replace with.
* @throws IOException
* (EOFException specifically, if memory ran out)
*... | 3.26 |
flink_InPlaceMutableHashTable_rebuild_rdh | /**
* Same as above, but the number of bucket segments of the new table can be specified.
*/
private void rebuild(long newNumBucketSegments) throws IOException {
// Get new bucket segments
releaseBucketSegments();
allocateBucketSegments(((int) (newNumBucketSegments)));
T record = buildSideSerializer... | 3.26 |
flink_InPlaceMutableHashTable_emit_rdh | /**
* Emits all elements currently held by the table to the collector.
*/
public void emit() throws IOException {
T record = buildSideSerializer.createInstance();
EntryIterator iter = getEntryIterator();
while (((record = iter.next(record)) != null) && (!closed)) {
outputCollector.collect(record);
if (!objectReus... | 3.26 |
flink_InPlaceMutableHashTable_getCapacity_rdh | /**
* Gets the total capacity of this hash table, in bytes.
*
* @return The hash table's total capacity.
*/
public long getCapacity()
{
return numAllMemorySegments * ((long) (segmentSize));
} | 3.26 |
flink_InPlaceMutableHashTable_m0_rdh | /**
* If there is wasted space (due to updated records not fitting in their old places), then do a
* compaction. Else, throw EOFException to indicate that memory ran out.
*
* @throws IOException
*/
private void m0() throws IOException { if (holes > (((double) (recordArea.getTotalSize())) * 0.05)) {
rebuild... | 3.26 |
flink_InPlaceMutableHashTable_noSeekAppendPointerAndRecord_rdh | /**
* Appends a pointer and a record. Call this function only if the write position is at the
* end!
*
* @param pointer
* The pointer to write (Note: this is NOT the position to write to!)
* @param record
* The record to write
* @return A pointer to the written data
* @throws IOException
* (EOFException... | 3.26 |
flink_InPlaceMutableHashTable_giveBackSegments_rdh | /**
* Moves all its memory segments to freeMemorySegments. Warning: this will leave the
* RecordArea in an unwritable state: you have to call setWritePosition before writing
* again.
*/
public void giveBackSegments() {
freeMemorySegments.addAll(segments);
segments.clear();
m1();
} | 3.26 |
flink_InPlaceMutableHashTable_readPointer_rdh | /**
* Note: this is sometimes a negated length instead of a pointer (see
* HashTableProber.updateMatch).
*/
public long readPointer() throws IOException {
return inView.readLong();
} | 3.26 |
flink_InPlaceMutableHashTable_insert_rdh | /**
* Inserts the given record into the hash table. Note: this method doesn't care about whether a
* record with the same key is already present.
*
* @param record
* The record to insert.
* @throws IOException
* (EOFException specifically, if memory ran out)
*/
@Override
public void insert(T record) throws ... | 3.26 |
flink_InPlaceMutableHashTable_updateMatch_rdh | /**
* This method can be called after getMatchFor returned a match. It will overwrite the
* record that was found by getMatchFor. Warning: The new record should have the same key as
* the old! WARNING; Don't do any modifications to the table between getMatchFor and
* updateMatch!
*
* @param newRecord
* The rec... | 3.26 |
flink_InPlaceMutableHashTable_getOccupancy_rdh | /**
* Gets the number of bytes currently occupied in this hash table.
*
* @return The number of bytes occupied.
*/
public long getOccupancy()
{
return (numAllMemorySegments * segmentSize) - (freeMemorySegments.size() *
segmentSize);
} | 3.26 |
flink_InPlaceMutableHashTable_overwritePointerAt_rdh | /**
* Overwrites the long value at the specified position.
*
* @param pointer
* Points to the position to overwrite.
* @param value
* The value to write.
* @throws IOException
*/
public void overwritePointerAt(long pointer, long value) throws IOException {
setWritePosition(pointer);outView.writeLong(va... | 3.26 |
flink_InPlaceMutableHashTable_freeSegmentsAfterAppendPosition_rdh | /**
* Releases the memory segments that are after the current append position. Note: The
* situation that there are segments after the current append position can arise from a call
* to resetAppendPosition().
*/
public void freeSegmentsAfterAppendPosition() {
final int appendSegmentIndex = ((int) (f0 >>> segmen... | 3.26 |
flink_InPlaceMutableHashTable_setWritePosition_rdh | // ----------------------- Output -----------------------
private void setWritePosition(long position) throws EOFException {
if (position > f0) {
throw new IndexOutOfBoundsException();
}
final int segmentIndex = ((int) (position >>> segmentSizeBits));
final int offset... | 3.26 |
flink_InPlaceMutableHashTable_getMemoryConsumptionString_rdh | /**
*
* @return String containing a summary of the memory consumption for error messages
*/
private String getMemoryConsumptionString() {
return ((((((((((((((((((("InPlaceMutableHashTable memory stats:\n" + "Total memory: ") + (numAllMemorySegments * segmentSize)) + "\n") + "Free memory: ") + (freeMe... | 3.26 |
flink_InPlaceMutableHashTable_appendPointerAndCopyRecord_rdh | /**
* Appends a pointer and a record. The record is read from a DataInputView (this will be the
* staging area).
*
* @param pointer
* The pointer to write (Note: this is NOT the position to write to!)
* @param input
* The DataInputView to read the record from
* @param recordSize
* The size of the record
... | 3.26 |
flink_InPlaceMutableHashTable_appendPointerAndRecord_rdh | /**
* Appends a pointer and a record.
*
* @param pointer
* The pointer to write (Note: this is NOT the position to write to!)
* @param record
* The record to write
* @return A pointer to the written data
* @throws IOException
* (EOFException specifically, if memory ran out)
*/
public long appendPointerA... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.