| # |
| # 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. |
| # |
| |
| env { |
| execution.parallelism = 1 |
| spark.sql.catalogImplementation = "hive" |
| } |
| |
| source { |
| hive { |
| pre_sql = "select * from mydb.mytb" |
| } |
| } |
| |
| transform { |
| sql { |
| sql = "select name,age from fake" |
| } |
| } |
| |
| sink { |
| ClickhouseFile { |
| host = "10.60.94.1:8123,10.60.94.2:8123,10.60.94.3:8123" |
| database = "mydb" |
| table = "access_msg" |
| fields = ["date", "datetime", "hostname", "http_code", "data_size", "ua", "request_time"] |
| username = "username" |
| password = "password" |
| sharding_key = "age" |
| clickhouse_local_path = "/usr/bin/clickhouse-local" |
| node_pass = [ |
| { |
| node_address = "10.60.94.1" |
| username = "clickhouse" |
| password = "password" |
| } |
| { |
| node_address = "10.60.94.2" |
| password = "password" |
| } |
| { |
| node_address = "10.60.94.3" |
| password = "password" |
| } |
| ] |
| } |
| } |