name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
flink_SharedBuffer_removeEvent_rdh
/** * Removes an event from cache and state. * * @param eventId * id of the event */ void removeEvent(EventId eventId) throws Exception { this.eventsBufferCache.invalidate(eventId); this.eventsBuffer.remove(eventId); }
3.26
flink_SharedBuffer_upsertEntry_rdh
/** * Inserts or updates a shareBufferNode in cache. * * @param nodeId * id of the event * @param entry * SharedBufferNode */ void upsertEntry(NodeId nodeId, Lockable<SharedBufferNode> entry) { this.entryCache.put(nodeId, entry); }
3.26
flink_SharedBuffer_getEntry_rdh
/** * It always returns node either from state or cache. * * @param nodeId * id of the node * @return SharedBufferNode */ Lockable<SharedBufferNode> getEntry(NodeId nodeId) { try { Lockable<SharedBufferNode> lockableFromCache = entryCache.getIfPresent(nodeId); if (Objects.nonNull(lockableFro...
3.26
flink_SharedBuffer_isEmpty_rdh
/** * Checks if there is no elements in the buffer. * * @return true if there is no elements in the buffer * @throws Exception * Thrown if the system cannot access the state. */ public boolean isEmpty() throws Exception {return Iterables.isEmpty(eventsBufferCache.asMap().keySet()) && Iterables.isEmpty(eventsBuf...
3.26
flink_SharedBuffer_upsertEvent_rdh
/** * Inserts or updates an event in cache. * * @param eventId * id of the event * @param event * event body */ void upsertEvent(EventId eventId, Lockable<V> event) { this.eventsBufferCache.put(eventId, event); }
3.26
flink_SharedBuffer_removeEntry_rdh
/** * Removes a ShareBufferNode from cache and state. * * @param nodeId * id of the event */ void removeEntry(NodeId nodeId) throws Exception { this.entryCache.invalidate(nodeId); this.entries.remove(nodeId); }
3.26
flink_TieredStorageResourceRegistry_clearResourceFor_rdh
/** * Remove all resources for the given owner. * * @param owner * identifier of the data that the resources correspond to. */ public void clearResourceFor(TieredStorageDataIdentifier owner) { List<TieredStorageResource> cleanersForOwner = registeredResources.remove(owner);...
3.26
flink_TieredStorageResourceRegistry_registerResource_rdh
/** * Register a new resource for the given owner. * * @param owner * identifier of the data that the resource corresponds to. * @param tieredStorageResource * the tiered storage resources to be registered. */ public void registerResource(TieredStorageDataIdentifier owner, TieredStorageResource tieredStorage...
3.26
flink_MapSerializer_isImmutableType_rdh
// ------------------------------------------------------------------------ // Type Serializer implementation // ------------------------------------------------------------------------ @Override public boolean isImmutableType() { return false; }
3.26
flink_MapSerializer_snapshotConfiguration_rdh
// -------------------------------------------------------------------------------------------- @Override public TypeSerializerSnapshot<Map<K, V>> snapshotConfiguration() { return new MapSerializerSnapshot<>(this); }
3.26
flink_MapSerializer_getKeySerializer_rdh
// ------------------------------------------------------------------------ // MapSerializer specific properties // ------------------------------------------------------------------------ public TypeSerializer<K> getKeySerializer() { return keySerializer;}
3.26
flink_RateLimitedSourceReader_start_rdh
// ------------------------------------------------------------------------ @Override public void start() { sourceReader.start(); }
3.26
flink_TypeInferenceOperandInference_inferOperandTypesOrError_rdh
// -------------------------------------------------------------------------------------------- private void inferOperandTypesOrError(FlinkTypeFactory typeFactory, CallContext callContext, RelDataType[] operandTypes) { final List<DataType> expectedDataTypes; // typed arguments have highest priority if (type...
3.26
flink_LookupCallContext_getKey_rdh
// -------------------------------------------------------------------------------------------- private LookupKey getKey(int pos) { final int index = lookupKeyOrder[pos]; return lookupKeys.get(index); }
3.26
flink_JobID_generate_rdh
// ------------------------------------------------------------------------ // Static factory methods // ------------------------------------------------------------------------ /** * Creates a new (statistically) random JobID. * * @return A new random JobID. */ public static JobID generate() { return new JobID...
3.26
flink_JobID_fromHexString_rdh
/** * Parses a JobID from the given string. * * @param hexString * string representation of a JobID * @return Parsed JobID * @throws IllegalArgumentException * if the JobID could not be parsed from the given string */ public static JobID fromHexString(String hexString) { try { return new JobID(S...
3.26
flink_JobID_fromByteArray_rdh
/** * Creates a new JobID from the given byte sequence. The byte sequence must be exactly 16 bytes * long. The first eight bytes make up the lower part of the ID, while the next 8 bytes make up * the upper part of the ID. * * @param bytes * The byte sequence. * @return A new JobID corresponding to the ID encod...
3.26
flink_Table_limit_rdh
/** * Limits a (possibly sorted) result to the first n rows from an offset position. * * <p>This method is a synonym for {@link #offset(int)} followed by {@link #fetch(int)}. */default Table limit(int offset, int fetch) { return offset(offset).fetch(fetch); }
3.26
flink_AbstractMapSerializer_isImmutableType_rdh
// ------------------------------------------------------------------------ // Type Serializer implementation // ------------------------------------------------------------------------ @Override public boolean isImmutableType() { return false; }
3.26
flink_AbstractMapSerializer_getKeySerializer_rdh
// ------------------------------------------------------------------------ /** * Returns the serializer for the keys in the map. * * @return The serializer for the keys in the map. */ public TypeSerializer<K> getKeySerializer() { return keySerializer; }
3.26
flink_TupleTypeInfoBase_getFieldTypes_rdh
/** * Returns the field types. */ public TypeInformation<?>[] getFieldTypes() { return types; }
3.26
flink_LogicalTypeUtils_toRowType_rdh
/** * Converts any logical type to a row type. Composite types are converted to a row type. Atomic * types are wrapped into a field. */ public static RowType toRowType(LogicalType t) { switch (t.getTypeRoot()) { case ROW : return ((RowType) (t)); case STRUCTURED_TYPE : fin...
3.26
flink_LogicalTypeUtils_renameRowFields_rdh
/** * Renames the fields of the given {@link RowType}. */ public static RowType renameRowFields(RowType rowType, List<String> newFieldNames) { Preconditions.checkArgument(rowType.getFieldCount() == newFieldNames.size(), "Row length and new names must match."); final List<RowField> newFields = IntStream.range(...
3.26
flink_LogicalTypeUtils_toInternalConversionClass_rdh
/** * Returns the conversion class for the given {@link LogicalType} that is used by the table * runtime as internal data structure. * * @see RowData */ public static Class<?> toInternalConversionClass(LogicalType type) { // ordered by type root definition switch ...
3.26
flink_LogicalTypeUtils_m1_rdh
/** * Returns a unique name for an atomic type. */ public static String m1(List<String> existingNames) { int i = 0; String v3 = ATOMIC_FIELD_NAME; while ((null != existingNames) && existingNames.contains(v3)) { v3 = (ATOMIC_FIELD_NAME + "_") + (i++); } return v3; }
3.26
flink_SubpartitionDiskCacheManager_removeAllBuffers_rdh
/** * Note that allBuffers can be touched by multiple threads. */ List<Tuple2<Buffer, Integer>> removeAllBuffers() { synchronized(allBuffers) {List<Tuple2<Buffer, Integer>> targetBuffers = new ArrayList<>(allBuffers); allBuffers.clear(); return targetBuffers; } }
3.26
flink_SubpartitionDiskCacheManager_startSegment_rdh
// ------------------------------------------------------------------------ // Called by DiskCacheManager // ------------------------------------------------------------------------ void startSegment(int segmentId) { synchronized(allBuffers) { this.segmentId = segmentId; } }
3.26
flink_SubpartitionDiskCacheManager_addBuffer_rdh
/** * This method is only called by the task thread. */ private void addBuffer(Buffer buffer) {synchronized(allBuffers) {allBuffers.add(new Tuple2<>(buffer, bufferIndex)); } bufferIndex++;}
3.26
flink_HighAvailabilityServicesUtils_getWebMonitorAddress_rdh
/** * Get address of web monitor from configuration. * * @param configuration * Configuration contains those for WebMonitor. * @param resolution * Whether to try address resolution of the given hostname or not. This allows * to fail fast in case that the hostname cannot be resolved. * @return Address of W...
3.26
flink_HighAvailabilityServicesUtils_createAvailableOrEmbeddedServices_rdh
/** * Utils class to instantiate {@link HighAvailabilityServices} implementations. */ public class HighAvailabilityServicesUtils {public static HighAvailabilityServices createAvailableOrEmbeddedServices(Configuration config, Executor executor, FatalErrorHandler fatalErrorHandler) throws Exception { HighAvail...
3.26
flink_HighAvailabilityServicesUtils_getJobManagerAddress_rdh
/** * Returns the JobManager's hostname and port extracted from the given {@link Configuration}. * * @param configuration * Configuration to extract the JobManager's address from * @return The JobManager's hostname and port * @throws ConfigurationExceptio...
3.26
flink_HighAvailabilityServicesUtils_getClusterHighAvailableStoragePath_rdh
/** * Gets the cluster high available storage path from the provided configuration. * * <p>The format is {@code HA_STORAGE_PATH/HA_CLUSTER_ID}. * * @param configuration * containing the configuration values * @return Path under which all highly available cluster artifacts are being stored */ public static Pat...
3.26
flink_KerberosUtils_getKrb5LoginModuleName_rdh
/* Return the Kerberos login module name */ public static String getKrb5LoginModuleName() { return System.getProperty("java.vendor").contains("IBM") ? "com.ibm.security.auth.module.Krb5LoginModule" : "com.sun.security.auth.module.Krb5LoginModule"; }
3.26
flink_RequestStatusOverview_readResolve_rdh
/** * Preserve the singleton property by returning the singleton instance */ private Object readResolve() { return INSTANCE; }
3.26
flink_RequestStatusOverview_hashCode_rdh
// ------------------------------------------------------------------------ @Override public int hashCode() { return RequestStatusOverview.class.hashCode(); }
3.26
flink_StreamElementSerializer_snapshotConfiguration_rdh
// -------------------------------------------------------------------------------------------- // Serializer configuration snapshotting & compatibility // // This serializer may be used by Flink internal operators that need to checkpoint // buffered records. Therefore, it may be part of managed state and need to impl...
3.26
flink_StreamElementSerializer_isImmutableType_rdh
// ------------------------------------------------------------------------ // Utilities // ------------------------------------------------------------------------ @Override public boolean isImmutableType() { return false; }
3.26
flink_StreamElementSerializer_equals_rdh
// ------------------------------------------------------------------------ // Utilities // ------------------------------------------------------------------------ @Override public boolean equals(Object obj) { if (obj instanceof StreamElementSerializer) { StreamElementSerializer<?> other = ((StreamElement...
3.26
flink_StreamElementSerializer_createInstance_rdh
// ------------------------------------------------------------------------ // Utilities // ------------------------------------------------------------------------ @Override public StreamRecord<T> createInstance() { return new StreamRecord<T>(typeSerializer.createInstance()); }
3.26
flink_OperatorCoordinatorCheckpointContext_notifyCheckpointAborted_rdh
/** * We override the method here to remove the checked exception. Please check the Java docs of * {@link CheckpointListener#notifyCheckpointAborted(long)} for more detail semantic of the * method. */ @Override default void notifyCheckpointAborted(long checkpointId) { }
3.26
flink_CastRuleProvider_cast_rdh
/** * Create a {@link CastExecutor} and execute the cast on the provided {@code value}. Fails with * {@link IllegalArgumentException} if the rule cannot be resolved, or with an exception from * the {@link CastExecutor} itself if the rule can fail. */ @SuppressWarnings("unchecked") @Nullable public static Object cas...
3.26
flink_CastRuleProvider_exists_rdh
/** * Returns {@code true} if and only if a {@link CastRule} can be resolved for the provided input * type and target type. */ public static boolean exists(LogicalType inputType, LogicalType targetType) { return resolve(inputType, targetType) != null; }
3.26
flink_CastRuleProvider_resolve_rdh
/* ------- Entrypoint ------- */ /** * Resolve a {@link CastRule} for the provided input type and target type. Returns {@code null} * if no rule can be resolved. */ @Nullable public static CastRule<?, ?> resolve(LogicalType inputType, LogicalType targetType) { return INSTANCE.internalResolve(inputType, targetTyp...
3.26
flink_CastRuleProvider_canFail_rdh
/** * Resolves the rule and returns the result of {@link CastRule#canFail(LogicalType, * LogicalType)}. Fails with {@link NullPointerException} if the rule cannot be resolved. */ public static boolean canFail(LogicalType inputType, LogicalType targetType) { return Preconditions.checkNotNull(resolve(inputTyp...
3.26
flink_CastRuleProvider_create_rdh
/** * Create a {@link CastExecutor} for the provided input type and target type. Returns {@code null} if no rule can be resolved. * * @see CastRule#create(CastRule.Context, LogicalType, LogicalType) */ @Nullable public static CastExecutor<?, ?> create(CastRule.Context context, LogicalType inputLogicalType, LogicalT...
3.26
flink_CastRuleProvider_generateAlwaysNonNullCodeBlock_rdh
/** * This method wraps {@link #generateCodeBlock(CodeGeneratorCastRule.Context, String, String, * LogicalType, LogicalType)}, but adding the assumption that the inputTerm is always non-null. * Used by {@link CodeGeneratorCastRule}s which checks for nullability, rather than deferring * the check to the rules. */ s...
3.26
flink_EncodingUtils_escapeJava_rdh
// -------------------------------------------------------------------------------------------- // Java String Escaping // // copied from o.a.commons.lang.StringEscapeUtils (commons-lang:2.4) // but without escaping forward slashes. // -----------------------------------------------------------------------------------...
3.26
flink_EncodingUtils_repeat_rdh
/** * Returns padding using the specified delimiter repeated to a given length. * * <pre> * StringUtils.repeat('e', 0) = "" * StringUtils.repeat('e', 3) = "eee" * StringUtils.repeat('e', -2) = "" * </pre> * * <p>Note: this method doesn't not support padding with <a * href="http://www.unicode.org/glossary/#s...
3.26
flink_EncodingUtils_decodeHex_rdh
/** * Converts an array of characters representing hexadecimal values into an array of bytes of * those same values. The returned array will be half the length of the passed array, as it * takes two characters to represent any given byte. An exception is thrown if the passed char * array has an odd number of elemen...
3.26
flink_EncodingUtils_toDigit_rdh
/** * Converts a hexadecimal character to an integer. * * <p>Copied from * https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/binary/Hex.java. * * @param ch * A character to convert to an integer digit * @param idx * The index of the character in the source * @retur...
3.26
flink_StringData_fromString_rdh
// ------------------------------------------------------------------------------------------ // Construction Utilities // ------------------------------------------------------------------------------------------ /** * Creates an instance of {@link StringData} from the given {@link String}. */ static StringData from...
3.26
flink_EmptyFieldsCountAccumulator_updateResultVector_rdh
/** * Increases the result vector component at the specified position by the specified delta. */ private void updateResultVector(int position, int delta) { // inflate the vector to contain the given position while (this.resultVector.size() <= position) { this.resultVector.add(0); } // increme...
3.26
flink_EmptyFieldsCountAccumulator_add_rdh
/** * Increases the result vector component at the specified position by 1. */ @Override public void add(Integer position) { updateResultVector(position, 1); }
3.26
flink_EmptyFieldsCountAccumulator_getDataSet_rdh
// UTIL METHODS // ************************************************************************* @SuppressWarnings("unchecked") private static DataSet<StringTriple> getDataSet(ExecutionEnvironment env, ParameterTool params) { if (params.has("input")) { return env.readCsvFile(params.get("input")).fieldDelimiter(...
3.26
flink_AvroInputFormat_getProducedType_rdh
// -------------------------------------------------------------------------------------------- // Typing // -------------------------------------------------------------------------------------------- @Override public TypeInformation<E> getProducedType() { return TypeExtractor.getForClass(this.avroValueType); }
3.26
flink_AvroInputFormat_getCurrentState_rdh
// -------------------------------------------------------------------------------------------- // Checkpointing // -------------------------------------------------------------------------------------------- @Override public Tuple2<Long, Long> getCurrentState() throws IOException { return new Tuple2<>(this.lastSync, ...
3.26
flink_AvroInputFormat_setReuseAvroValue_rdh
/** * Sets the flag whether to reuse the Avro value instance for all records. By default, the input * format reuses the Avro value. * * @param reuseAvroValue * True, if the input format should reuse the Avro value instance, false * otherwise. */ public void setReuseAvroVal...
3.26
flink_AvroInputFormat_open_rdh
// -------------------------------------------------------------------------------------------- // Input Format Methods // -------------------------------------------------------------------------------------------- @Override public void open(FileInputSplit split) throws IOException { super.open(split); f0 = initReader...
3.26
flink_AvroInputFormat_setUnsplittable_rdh
/** * If set, the InputFormat will only read entire files. */ public void setUnsplittable(boolean unsplittable) { this.unsplittable = unsplittable; }
3.26
flink_TestingSplitEnumeratorContext_metricGroup_rdh
// ------------------------------------------------------------------------ // SplitEnumeratorContext methods // ------------------------------------------------------------------------ @Override public SplitEnumeratorMetricGroup metricGroup() { return UnregisteredMetricsGroup.createSplitEnumeratorMetricGroup(); }
3.26
flink_TestingSplitEnumeratorContext_triggerAllActions_rdh
// ------------------------------------------------------------------------ // access to events / properties / execution // ------------------------------------------------------------------------ public void triggerAllActions() { executor.triggerPeriodicScheduledTasks(); executor.triggerAll(); }
3.26
flink_DynamicSinkUtils_convertExternalToRel_rdh
/** * Converts an external sink (i.e. further {@link DataStream} transformations) to a {@link RelNode}. */ public static RelNode convertExternalToRel(FlinkRelBuilder relBuilder, RelNode input, ExternalModifyOperation externalModifyOperation) { final DynamicTableSink tableSink = new ExternalDynamicSink(externalMod...
3.26
flink_DynamicSinkUtils_addExtraMetaCols_rdh
/** * Add extra meta columns for underlying table scan, return a new resolve schema after adding * extra meta columns. */ private static ResolvedSchema addExtraMetaCols(LogicalTableModify tableModify, LogicalTableScan tableScan, String tableDebugName, List<MetadataColumn> metadataColumns, FlinkTypeFactory typeFact...
3.26
flink_DynamicSinkUtils_convertSinkToRel_rdh
/** * Converts a given {@link DynamicTableSink} to a {@link RelNode}. It adds helper projections if * necessary. */ public static RelNode convertSinkToRel(FlinkRelBuilder relBuilder, RelNode input, SinkModifyOperation sinkModifyOperation, DynamicTableSink sink) { return convertSinkToRel(relBuilder, in...
3.26
flink_DynamicSinkUtils_prepareDynamicSink_rdh
/** * Prepares the given {@link DynamicTableSink}. It check whether the sink is compatible with the * INSERT INTO clause and applies initial parameters. */ private static void prepareDynamicSink(String tableDebugName, Map<String, String> staticPartitions, boolean isOverwrite, DynamicTableSink sink, ResolvedCatalog...
3.26
flink_DynamicSinkUtils_convertPredicateToNegative_rdh
/** * Convert the predicate in WHERE clause to the negative predicate. */ private static void convertPredicateToNegative(LogicalTableModify tableModify) { RexBuilder rexBuilder = tableModify.getCluster().getRexBuilder(); RelNode input = tableModify.getI...
3.26
flink_DynamicSinkUtils_getPhysicalColumnIndices_rdh
/** * Return the indices from {@param colIndexes} that belong to physical column. */private static int[] getPhysicalColumnIndices(List<Integer> colIndexes, ResolvedSchema schema) { return colIndexes.stream().filter(i -> schema.getColumns().get(i).isPhysical()).mapToInt(i -> i).toArray(); }
3.26
flink_DynamicSinkUtils_createRequiredMetadataColumns_rdh
/** * Returns a list of required metadata columns. Ordered by the iteration order of {@link SupportsWritingMetadata#listWritableMetadata()}. * * <p>This method assumes that sink and schema have been validated via {@link #prepareDynamicSink}. */ private static List<MetadataColumn> createRequiredMetadataColumns(Resol...
3.26
flink_DynamicSinkUtils_validateSchemaAndApplyImplicitCast_rdh
/** * Checks if the given query can be written into the given sink type. * * <p>It checks whether field types are compatible (types should be equal including precisions). * If types are not compatible, but can be implicitly cast, a cast projection will be applied. * Otherwise, an exception will be thrown. */ priv...
3.26
flink_DynamicSinkUtils_createConsumedType_rdh
/** * Returns the {@link DataType} that a sink should consume as the output from the runtime. * * <p>The format looks as follows: {@code PHYSICAL COLUMNS + PERSISTED METADATA COLUMNS} */ private static RowType createConsumedType(ResolvedSchema schema, DynamicTableSink sink) { final Map<String, DataType> metadataMa...
3.26
flink_DynamicSinkUtils_convertCollectToRel_rdh
/** * Converts an {@link TableResult#collect()} sink to a {@link RelNode}. */ public static RelNode convertCollectToRel(FlinkRelBuilder relBuilder, RelNode input, CollectModifyOperation collectModifyOperation, ReadableConfig configuration, ClassLoader classLoader) { final DataTypeFactory dataTypeFactory = unwrapC...
3.26
flink_DynamicSinkUtils_fixCollectDataType_rdh
// -------------------------------------------------------------------------------------------- /** * Temporary solution until we drop legacy types. */ private static DataType fixCollectDataType(DataTypeFactory dataTypeFactory, ResolvedSchema schema) { final DataType fixedDataType = DataTypeUtils.transform(dataTypeFa...
3.26
flink_DynamicSinkUtils_projectColumnsForUpdate_rdh
// create a project only select the required column or expression for update private static RelNode projectColumnsForUpdate(LogicalTableModify tableModify, int originColsCount, ResolvedSchema resolvedSchema, List<Integer> updatedIndexes, SupportsRowLevelUpdate.RowLevelUpdateMode updateMode, String tableDebugName, Data...
3.26
flink_StreamingRuntimeContext_isCheckpointingEnabled_rdh
// ------------------ expose (read only) relevant information from the stream config -------- // /** * Returns true if checkpointing is enabled for the running job. * * @return true if checkpointing is enabled. */ public boolean isCheckpointingEnabled() { return streamConfig.isCheckpointingEnabled(); }
3.26
flink_StreamingRuntimeContext_m0_rdh
/** * Returns the task manager runtime info of the task manager running this stream task. * * @return The task manager runtime info. */ public TaskManagerRuntimeInfo m0() { return taskEnvironment.getTaskManagerInfo(); }
3.26
flink_StreamingRuntimeContext_hasBroadcastVariable_rdh
// ------------------------------------------------------------------------ // broadcast variables // ------------------------------------------------------------------------ @Override public boolean hasBroadcastVariable(String name) { throw new UnsupportedOperationException("Broadcast variables can only be used in Dat...
3.26
flink_StreamingRuntimeContext_getState_rdh
// ------------------------------------------------------------------------ // key/value state // ------------------------------------------------------------------------ @Override public <T> ValueState<T> getState(ValueStateDescriptor<T> stateProperties) { KeyedStateStore keyedStateStore = checkPreconditionsAn...
3.26
flink_StreamingRuntimeContext_getInputSplitProvider_rdh
// ------------------------------------------------------------------------ /** * Returns the input split provider associated with the operator. * * @return The input split provider. */ public InputSplitProvider getInputSplitProvider() { return taskEnvironment.getInputSplitProvider(); }
3.26
flink_WritableSerializer_ensureInstanceInstantiated_rdh
// -------------------------------------------------------------------------------------------- private void ensureInstanceInstantiated() { if (copyInstance == null) { copyInstance = createInstance(); }}
3.26
flink_WritableSerializer_snapshotConfiguration_rdh
// -------------------------------------------------------------------------------------------- // Serializer configuration snapshotting & compatibility // -------------------------------------------------------------------------------------------- @Override public TypeSerializerSnapshot<T> snapshotConfiguration() { ...
3.26
flink_WritableSerializer_hashCode_rdh
// -------------------------------------------------------------------------------------------- @Override public int hashCode() { return this.typeClass.hashCode(); }
3.26
flink_HiveTableUtil_createSchema_rdh
/** * Create a Flink's Schema from Hive table's columns and partition keys. */ public static Schema createSchema(List<FieldSchema> nonPartCols, List<FieldSchema> partitionKeys, Set<String> notNullColumns, @Nullable UniqueConstraint primaryKey) { Tuple2<String[], DataType[]> columnInformation = getColumnInformatio...
3.26
flink_HiveTableUtil_relyConstraint_rdh
// returns a constraint trait that requires RELY public static byte relyConstraint(byte trait) { return ((byte) (trait | HIVE_CONSTRAINT_RELY)); }
3.26
flink_HiveTableUtil_createHivePartition_rdh
// -------------------------------------------------------------------------------------------- // Helper methods // -------------------------------------------------------------------------------------------- /** * Creates a Hive partition instance. */public static Partition createHivePartition(String dbName, String...
3.26
flink_HiveTableUtil_maskFlinkProperties_rdh
/** * Add a prefix to Flink-created properties to distinguish them from Hive-created properties. */ private static Map<String, String> maskFlinkProperties(Map<String, String> properties) { return properties.entrySet().stream().filter(e -> (e.getKey() != null) && (e.getValue() != null)).map(e -> new Tuple2<>(FLINK...
3.26
flink_HiveTableUtil_createHiveColumns_rdh
/** * Create Hive columns from Flink ResolvedSchema. */ public static List<FieldSchema> createHiveColumns(ResolvedSchema schema) {String[] fieldNames = schema.getColumnNames().toArray(new String[0]); DataType[] fieldTypes = schema.getColumnDataTypes().toArray(new DataType[0]); List<FieldSchema> v16 = new A...
3.26
flink_HiveTableUtil_checkAcidTable_rdh
/** * Check whether to read or write on the hive ACID table. * * @param tableOptions * Hive table options. * @param tablePath * Identifier table path. * @throws FlinkHiveException * Thrown, if the source or sink table is transactional. */ public static void checkAcidTable(Map<String, String> tableOption...
3.26
flink_HiveTableUtil_initiateTableFromProperties_rdh
/** * Extract DDL semantics from properties and use it to initiate the table. The related * properties will be removed from the map after they're used. */ private static void initiateTableFromProperties(Table hiveTable, Map<String, String> properties, HiveConf hiveConf) { extractExternal(hiveTable, properties);...
3.26
flink_HiveTableUtil_getHadoopConfiguration_rdh
/** * Returns a new Hadoop Configuration object using the path to the hadoop conf configured. * * @param hadoopConfDir * Hadoop conf directory path. * @return A Hadoop configuration instance. */ public static Configuration getHadoopConfiguration(String hadoopConfDir) { if (new File(hadoopConfDir).exists...
3.26
flink_HiveTableUtil_enableConstraint_rdh
// returns a constraint trait that requires ENABLE public static byte enableConstraint(byte trait) { return ((byte) (trait | HIVE_CONSTRAINT_ENABLE)); }
3.26
flink_HiveTableUtil_createResolvedSchema_rdh
/** * Create a Flink's ResolvedSchema from Hive table's columns and partition keys. */ public static ResolvedSchema createResolvedSchema(List<FieldSchema> nonPartCols, List<FieldSchema> partitionKeys, Set<String> notNullColumns, @Nullable UniqueConstraint primaryKey) { Tuple2<String[], DataType[]> columnInformati...
3.26
flink_HiveTableUtil_extractHiveTableInfo_rdh
/** * Get the hive table's information. * * @return non-part fields, part fields, notNullColumns, primaryKey. */ private static Tuple4<List<FieldSchema>, List<FieldSchema>, Set<String>, Optional<UniqueConstraint>> extractHiveTableInfo(HiveConf hiveConf, Table hiveTable, HiveMetastoreClientW...
3.26
flink_HiveTableUtil_extractRowType_rdh
/** * Create the Hive table's row type. */ public static DataType extractRowType(HiveConf hiveConf, Table hiveTable, HiveMetastoreClientWrapper client, HiveShim hiveShim) { Tuple4<List<FieldSchema>, List<FieldSchema>, Set<String>, Optional<UniqueConstraint>> hiveTableInfo = extractHiveTableInfo(hiveConf, hiveTab...
3.26
flink_LongHybridHashTable_putBuildRow_rdh
// ---------------------- interface to join operator --------------------------------------- public void putBuildRow(BinaryRowData row) throws IOException { long key = getBuildLongKey(row); final int hashCode = hashLong(key, 0); m0(key, hashCode, row); }
3.26
flink_LongHybridHashTable_get_rdh
/** * This method is only used for operator fusion codegen to get build row from hash table. If the * build partition has spilled to disk, return null directly which requires the join operator * also spill probe row to disk. */ @Nullable public final RowIterator<BinaryRowData> get(long p...
3.26
flink_LongHybridHashTable_tryDenseMode_rdh
// ---------------------- interface to join operator end ----------------------------------- /** * After build end, try to use dense mode. */private void tryDenseMode() { // if some partitions have spilled to disk, always use hash mode if (numSpillFiles != 0) { ...
3.26
flink_LongHybridHashTable_insertIntoProbeBuffer_rdh
/** * If the probe row corresponding partition has been spilled to disk, just call this method * spill probe row to disk. * * <p>Note: This must be called only after {@link LongHybridHashTable#get} method. */ public final void insertIntoProbeBuffer(RowData probeRecord) throws IOException { checkNotNull(current...
3.26
flink_ExecNodeContext_getTypeAsString_rdh
/** * Returns the {@link #name} and {@link #version}, to be serialized into the JSON plan as one * string, which in turn will be parsed by {@link ExecNodeContext#ExecNodeContext(String)} when * deserialized from a JSON plan or when needed by {@link ExecNodeTypeIdResolver#typeFromId(DatabindContext, String)}. */ @Js...
3.26
flink_ExecNodeContext_generateUid_rdh
/** * Returns a new {@code uid} for transformations. */ public String generateUid(String transformationName, ExecNodeConfig config) { if (!transformationNamePattern.matcher(transformationName).matches()) { throw new TableException((("Invalid transformation name '" + transformationName) + "'. ") + ...
3.26
flink_ExecNodeContext_newNodeId_rdh
/** * Generate an unique ID for ExecNode. */ public static int newNodeId() { return idCounter.incrementAndGet(); }
3.26