blob: eae86f65058ca5e295557d048ff79e497d61837a [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// NOTE: File flink_fn_execution_pb2.py is generated from this file. Please re-generate it by calling
// gen_protos.py whenever this file is changed.
syntax = "proto3";
package org.apache.flink.fn_execution.v1;
option java_package = "org.apache.flink.fnexecution.v1";
option java_outer_classname = "FlinkFnApi";
message Input {
oneof input {
UserDefinedFunction udf = 1;
int32 inputOffset = 2;
bytes inputConstant = 3;
}
}
// User-defined function definition. It supports chaining functions, that's, the execution
// result of one user-defined function as the input of another user-defined function.
message UserDefinedFunction {
// The serialized representation of the user-defined function
bytes payload = 1;
// The input arguments of the user-defined function, it could be one of the following:
// 1. A column from the input row
// 2. The result of another user-defined function
// 3. The constant value of the column
repeated Input inputs = 2;
// The index of the over window used in pandas batch over window aggregation
int32 window_index = 3;
// Whether it's pandas UDF
bool is_pandas_udf = 5;
}
// A list of user-defined functions to be executed in a batch.
message UserDefinedFunctions {
repeated UserDefinedFunction udfs = 1;
bool metric_enabled = 2;
repeated OverWindow windows = 3;
}
// Used to describe the info of over window in pandas batch over window aggregation
message OverWindow {
enum WindowType {
RANGE_UNBOUNDED = 0;
RANGE_UNBOUNDED_PRECEDING = 1;
RANGE_UNBOUNDED_FOLLOWING = 2;
RANGE_SLIDING = 3;
ROW_UNBOUNDED = 4;
ROW_UNBOUNDED_PRECEDING = 5;
ROW_UNBOUNDED_FOLLOWING = 6;
ROW_SLIDING = 7;
}
WindowType window_type = 1;
int64 lower_boundary = 2;
int64 upper_boundary = 3;
}
// User defined DataStream function definition.
message UserDefinedDataStreamFunction {
enum FunctionType {
MAP = 0;
FLAT_MAP = 1;
REDUCE = 2;
CO_MAP = 3;
CO_FLAT_MAP = 4;
PROCESS = 5;
KEYED_PROCESS = 6;
TIMESTAMP_ASSIGNER = 7;
}
message JobParameter {
string key = 1;
string value = 2;
}
message RuntimeContext {
string task_name = 1;
string task_name_with_subtasks = 2;
int32 number_of_parallel_subtasks = 3;
int32 max_number_of_parallel_subtasks = 4;
int32 index_of_this_subtask = 5;
int32 attempt_number = 6;
repeated JobParameter job_parameters = 7;
}
FunctionType function_type = 1;
RuntimeContext runtime_context = 2;
bytes payload = 3;
bool metric_enabled = 4;
TypeInfo key_type_info = 5;
}
message UserDefinedAggregateFunction {
message DataViewSpec {
message ListView {
Schema.FieldType element_type = 1;
}
message MapView {
Schema.FieldType key_type = 1;
Schema.FieldType value_type = 2;
}
string name = 1;
int32 field_index = 2;
oneof data_view {
ListView list_view = 3;
MapView map_view = 4;
}
}
// The serialized representation of the user-defined function
bytes payload = 1;
// The input arguments of the user-defined function, it could be one of the following:
// 1. A column from the input row
// 2. The result of another user-defined function
// 3. The constant value of the column
repeated Input inputs = 2;
repeated DataViewSpec specs = 3;
int32 filter_arg = 4;
bool distinct = 5;
}
// A list of the user-defined aggregate functions to be executed in a group aggregate operation.
message UserDefinedAggregateFunctions {
repeated UserDefinedAggregateFunction udfs = 1;
bool metric_enabled = 2;
// The array of the key indexes.
repeated int32 grouping = 3;
// Generate retract messages if true.
bool generate_update_before = 4;
// The schema of the grouping keys.
Schema.FieldType key_type = 5;
// The index of a count aggregate used to calculate the number of accumulated rows.
int32 index_of_count_star = 6;
// Cleanup the expired state if true.
bool state_cleaning_enabled = 7;
// The state cache size.
int32 state_cache_size = 8;
// The map state read cache size.
int32 map_state_read_cache_size = 9;
// The map_state_write_cache_size.
int32 map_state_write_cache_size = 10;
// True if the count(*) agg is inserted by the planner.
bool count_star_inserted = 11;
}
// A representation of the data schema.
message Schema {
enum TypeName {
ROW = 0;
TINYINT = 1;
SMALLINT = 2;
INT = 3;
BIGINT = 4;
DECIMAL = 5;
FLOAT = 6;
DOUBLE = 7;
DATE = 8;
TIME = 9;
TIMESTAMP = 10;
BOOLEAN = 11;
BINARY = 12;
VARBINARY = 13;
CHAR = 14;
VARCHAR = 15;
BASIC_ARRAY = 16;
MAP = 17;
MULTISET = 18;
LOCAL_ZONED_TIMESTAMP = 19;
ZONED_TIMESTAMP = 20;
}
message MapInfo {
FieldType key_type = 1;
FieldType value_type = 2;
}
message TimeInfo {
int32 precision = 1;
}
message TimestampInfo {
int32 precision = 1;
}
message LocalZonedTimestampInfo {
int32 precision = 1;
}
message ZonedTimestampInfo {
int32 precision = 1;
}
message DecimalInfo {
int32 precision = 1;
int32 scale = 2;
}
message BinaryInfo {
int32 length = 1;
}
message VarBinaryInfo {
int32 length = 1;
}
message CharInfo {
int32 length = 1;
}
message VarCharInfo {
int32 length = 1;
}
message FieldType {
TypeName type_name = 1;
bool nullable = 2;
oneof type_info {
FieldType collection_element_type = 3;
MapInfo map_info = 4;
Schema row_schema = 5;
DecimalInfo decimal_info = 6;
TimeInfo time_info = 7;
TimestampInfo timestamp_info = 8;
LocalZonedTimestampInfo local_zoned_timestamp_info = 9;
ZonedTimestampInfo zoned_timestamp_info = 10;
BinaryInfo binary_info = 11;
VarBinaryInfo var_binary_info = 12;
CharInfo char_info = 13;
VarCharInfo var_char_info = 14;
}
}
message Field {
string name = 1;
string description = 2;
FieldType type = 3;
}
repeated Field fields = 1;
}
// A representation of the data type information in DataStream.
message TypeInfo {
enum TypeName {
ROW = 0;
STRING = 1;
BYTE = 2;
BOOLEAN = 3;
SHORT = 4;
INT = 5;
LONG = 6;
FLOAT = 7;
DOUBLE = 8;
CHAR = 9;
BIG_INT = 10;
BIG_DEC = 11;
SQL_DATE = 12;
SQL_TIME = 13;
SQL_TIMESTAMP = 14;
BASIC_ARRAY = 15;
PICKLED_BYTES = 16;
TUPLE = 17;
PRIMITIVE_ARRAY = 18;
}
message FieldType {
TypeName type_name = 1;
oneof type_info {
FieldType collection_element_type = 2;
TypeInfo row_type_info = 3;
TypeInfo tuple_type_info = 4;
}
}
message Field {
string name = 1;
//description is used in Table schema, no need in DataStream.
string description = 2;
FieldType type = 3;
}
repeated Field field = 1;
}