-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flink backend implementation #1629
Closed
Closed
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
dac4323
Laungh local flink engine container successfully
yanghua 502d3f0
pass
pan3793 c12b5ca
Server UT pass
pan3793 25b6b57
hadoop-client-api
pan3793 9ae5455
Fix CI
pan3793 16edd52
Cleanup
pan3793 b258d81
cleanup
pan3793 d84720b
SessionContext
pan3793 303e2f1
Restore log conf
pan3793 c1560fd
nit
pan3793 10fb2bc
CI
pan3793 8a9e37f
nit
pan3793 68efa42
log
pan3793 3b4e86a
deps
pan3793 a4496c3
Fix reflection
pan3793 b7e5f0e
revert tgz name change
pan3793 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env bash | ||
################################################################################ | ||
# 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. | ||
################################################################################ | ||
|
||
################################################################################ | ||
# Adopted from "flink" bash script | ||
################################################################################ | ||
|
||
if [[ -z "$FLINK_HOME" || ! -d "$FLINK_HOME" ]]; then | ||
(>&2 echo "Invalid FLINK_HOME: ${FLINK_HOME:-unset}") | ||
exit 1 | ||
fi | ||
|
||
FLINK_SQL_ENGINE_HOME="$(cd "$(dirname "$0")"/..; pwd)" | ||
if [[ "$FLINK_SQL_ENGINE_HOME" == "$KYUUBI_HOME/externals/engines/flink" ]]; then | ||
FLINK_SQL_ENGINE_CONF_DIR="$FLINK_SQL_ENGINE_HOME/conf" | ||
FLINK_SQL_ENGINE_LIB_DIR="$FLINK_SQL_ENGINE_HOME/lib" | ||
FLINK_SQL_ENGINE_LOG_DIR="$KYUUBI_LOG_DIR" | ||
FLINK_SQL_ENGINE_JAR=$(find "$FLINK_SQL_ENGINE_LIB_DIR" -regex ".*/kyuubi-flink-sql-engine_.*\.jar") | ||
FLINK_HADOOP_CLASSPATH="$INTERNAL_HADOOP_CLASSPATHS" | ||
else | ||
echo -e "\nFLINK_SQL_ENGINE_HOME $FLINK_SQL_ENGINE_HOME doesn't match production directory, assuming in development environment..." | ||
FLINK_SQL_ENGINE_CONF_DIR="$FLINK_SQL_ENGINE_HOME/conf" | ||
FLINK_SQL_ENGINE_LIB_DIR="$FLINK_SQL_ENGINE_HOME/target" | ||
FLINK_SQL_ENGINE_LOG_DIR="$FLINK_SQL_ENGINE_HOME/target" | ||
FLINK_SQL_ENGINE_JAR=$(find "$FLINK_SQL_ENGINE_LIB_DIR" -regex '.*/kyuubi-flink-sql-engine_.*\.jar$' | grep -v '\-javadoc.jar$' | grep -v '\-tests.jar$') | ||
_FLINK_SQL_ENGINE_HADOOP_CLIENT_JARS=$(find $FLINK_SQL_ENGINE_LIB_DIR -regex '.*/hadoop-client-.*\.jar$' | tr '\n' ':') | ||
FLINK_HADOOP_CLASSPATH="${_FLINK_SQL_ENGINE_HADOOP_CLIENT_JARS%:}" | ||
fi | ||
|
||
# do NOT let config.sh detect FLINK_HOME | ||
_FLINK_HOME_DETERMINED=1 . "$FLINK_HOME/bin/config.sh" | ||
|
||
FLINK_IDENT_STRING=${FLINK_IDENT_STRING:-"$USER"} | ||
FLINK_SQL_CLIENT_JAR=$(find "$FLINK_OPT_DIR" -regex ".*flink-sql-client.*.jar") | ||
CC_CLASSPATH=`constructFlinkClassPath` | ||
|
||
FULL_CLASSPATH="$FLINK_SQL_ENGINE_JAR:$FLINK_SQL_CLIENT_JAR:$CC_CLASSPATH:$FLINK_HADOOP_CLASSPATH" | ||
|
||
log_file="$FLINK_SQL_ENGINE_LOG_DIR/kyuubi-flink-sql-engine-$FLINK_IDENT_STRING-$HOSTNAME.log" | ||
log_setting=( | ||
-Dlog.file="$log_file" | ||
-Dlog4j.configurationFile=file:"$FLINK_SQL_ENGINE_CONF_DIR/log4j.properties" | ||
-Dlog4j.configuration=file:"$FLINK_SQL_ENGINE_CONF_DIR/log4j.properties" | ||
-Dlogback.configurationFile=file:"$FLINK_SQL_ENGINE_CONF_DIR/logback.xml" | ||
) | ||
|
||
if [ -n "$FLINK_SQL_ENGINE_JAR" ]; then | ||
exec $JAVA_RUN ${FLINK_SQL_ENGINE_DYNAMIC_ARGS} "${log_setting[@]}" -cp ${FULL_CLASSPATH} \ | ||
org.apache.kyuubi.engine.flink.FlinkSQLEngine "$@" | ||
else | ||
(>&2 echo "[ERROR] Flink SQL Engine JAR file 'kyuubi-flink-sql-engine*.jar' should be located in $FLINK_SQL_ENGINE_LIB_DIR.") | ||
exit 1 | ||
fi |
167 changes: 167 additions & 0 deletions
167
externals/kyuubi-flink-sql-engine/conf/flink-conf.yaml.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
################################################################################ | ||
# 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. | ||
################################################################################ | ||
|
||
|
||
# This file defines the default environment for Flink's SQL Engine. | ||
# Defaults might be overwritten by a session specific environment. | ||
|
||
#============================================================================== | ||
# Engine server properties | ||
#============================================================================== | ||
server: | ||
# The address that the engine binds itself. | ||
bind-address: 127.0.0.1 | ||
# The address that should be used by clients to connect to the engine. | ||
address: 127.0.0.1 | ||
# The port that the client connects to. | ||
port: 8083 | ||
# The jvm args for SQL engine process, | ||
# like -Xmx2018m -Xms1024m -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps ... | ||
jvm_args: "-Xmx2018m -Xms1024m" | ||
|
||
|
||
#============================================================================== | ||
# Session properties | ||
#============================================================================== | ||
session: | ||
# Session will be closed when it's not accessed for this duration, which can be disabled by setting to zero. | ||
# the minimum unit is in milliseconds. | ||
idle-timeout: 1d | ||
# The check interval for session idle timeout, which can be disabled by setting to zero. | ||
# the minimum unit is in milliseconds. | ||
check-interval: 1h | ||
# Max count of active sessions, which can be disabled by setting to zero. | ||
max-count: 1000000 | ||
|
||
|
||
# See the Table API & SQL documentation for details about supported properties. | ||
|
||
#============================================================================== | ||
# Tables | ||
#============================================================================== | ||
|
||
# Define tables here such as sources, sinks, views, or temporal tables. | ||
|
||
tables: [] # empty list | ||
# A typical table source definition looks like: | ||
# - name: ... | ||
# type: source-table | ||
# connector: ... | ||
# format: ... | ||
# schema: ... | ||
|
||
# A typical view definition looks like: | ||
# - name: ... | ||
# type: view | ||
# query: "SELECT ..." | ||
|
||
# A typical temporal table definition looks like: | ||
# - name: ... | ||
# type: temporal-table | ||
# history-table: ... | ||
# time-attribute: ... | ||
# primary-key: ... | ||
|
||
|
||
#============================================================================== | ||
# User-defined functions | ||
#============================================================================== | ||
|
||
# Define scalar, aggregate, or table functions here. | ||
|
||
functions: [] # empty list | ||
# A typical function definition looks like: | ||
# - name: ... | ||
# from: class | ||
# class: ... | ||
# constructor: ... | ||
|
||
|
||
#============================================================================== | ||
# Catalogs | ||
#============================================================================== | ||
|
||
# Define catalogs here. | ||
|
||
catalogs: [] # empty list | ||
# A typical catalog definition looks like: | ||
# - name: myhive | ||
# type: hive | ||
# hive-conf-dir: /opt/hive_conf/ | ||
# default-database: ... | ||
|
||
#============================================================================== | ||
# Modules | ||
#============================================================================== | ||
|
||
# Define modules here. | ||
|
||
#modules: # note the following modules will be of the order they are specified | ||
# - name: core | ||
# type: core | ||
|
||
#============================================================================== | ||
# Execution properties | ||
#============================================================================== | ||
|
||
# Properties that change the fundamental execution behavior of a table program. | ||
|
||
execution: | ||
# parallelism of the program | ||
parallelism: 1 | ||
# maximum parallelism | ||
max-parallelism: 128 | ||
# current catalog ('default_catalog' by default) | ||
current-catalog: default_catalog | ||
# current database of the current catalog (default database of the catalog by default) | ||
current-database: default_database | ||
|
||
#============================================================================== | ||
# Configuration options | ||
#============================================================================== | ||
|
||
# Configuration options for adjusting and tuning table programs. | ||
|
||
# A full list of options and their default values can be found | ||
# on the dedicated "Configuration" web page. | ||
|
||
# A configuration can look like: | ||
# configuration: | ||
# table.exec.spill-compression.enabled: true | ||
# table.exec.spill-compression.block-size: 128kb | ||
# table.optimizer.join-reorder-enabled: true | ||
|
||
#============================================================================== | ||
# Deployment properties | ||
#============================================================================== | ||
|
||
# Properties that describe the cluster to which table programs are submitted to. | ||
|
||
deployment: | ||
# general cluster communication timeout in ms | ||
response-timeout: 5000 | ||
# (optional) address from cluster to engine | ||
engine-address: "" | ||
# (optional) port from cluster to engine | ||
engine-port: 0 | ||
|
||
#============================================================================== | ||
# Deployment properties | ||
#============================================================================== | ||
|
||
# Properties that describe the cluster to which table programs are submitted to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
################################################################################ | ||
# 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. | ||
################################################################################ | ||
|
||
# This affects logging for both kyuubi-flink-sql-engine and Flink | ||
log4j.rootLogger=INFO, CA | ||
|
||
#Console Appender | ||
log4j.appender.CA=org.apache.log4j.ConsoleAppender | ||
log4j.appender.CA.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.CA.layout.ConversionPattern=%d{HH:mm:ss.SSS} %p %c: %m%n | ||
log4j.appender.CA.Threshold = FATAL | ||
|
||
# Log all infos in the given file | ||
log4j.appender.file=org.apache.log4j.FileAppender | ||
log4j.appender.file.file=${log.file} | ||
log4j.appender.file.append=false | ||
log4j.appender.file.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n | ||
|
||
#File Appender | ||
log4j.appender.FA=org.apache.log4j.FileAppender | ||
log4j.appender.FA.append=false | ||
log4j.appender.FA.file=target/unit-tests.log | ||
log4j.appender.FA.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.FA.layout.ConversionPattern=%d{HH:mm:ss.SSS} %t %p %c{2}: %m%n | ||
|
||
# Set the logger level of File Appender to DEBUG | ||
log4j.appender.FA.Threshold = DEBUG |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build/dist --tgz --flink-provided --spark-provided
=>apache-kyuubi-1.5.0-SNAPSHOT-bin.tgz
build/dist --tgz --name custom
=>apache-kyuubi-1.5.0-SNAPSHOT-bin-custom.tgz
build/dist --tgz --spark-provided
=>apache-kyuubi-1.5.0-SNAPSHOT-bin-flink-1.14.tgz
build/dist --tgz --flink-provided
=>apache-kyuubi-1.5.0-SNAPSHOT-spark-3.1-hadoop3.2.tgz
build/dist --tgz
=>apache-kyuubi-1.5.0-SNAPSHOT-bin-flink-1.14-spark-3.1-hadoop3.2.tgz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this name pattern looks good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, I am fine with the naming. But, if we introduce trino/presto, the name would be very long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not good, we have a release file already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only have one apache official release binary tarball
apache-kyuubi-{VERSION}-bin.tgz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's leave it as-is, we don't change the naming policy with a new engine added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted