Skip to content

Commit

Permalink
init kylin connector
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhaijun87 committed Aug 12, 2021
1 parent 1bca8e1 commit de66ed1
Show file tree
Hide file tree
Showing 27 changed files with 1,998 additions and 0 deletions.
43 changes: 43 additions & 0 deletions hetu-docs/en/connector/kylin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

Kylin Connector
===============

The Kylin connector allows querying tables in an external Kylin database. This can be used to join data between different systems like Kylin and Hive, or between two different Kylin instances.

Configuration
-------------

To configure the Kylin connector, create a catalog properties file in`etc/catalog` named, for example, `Kylin.properties`, to mount the Kylin connector as the `Kylin` catalog. Create the file with the following
contents, replacing the connection properties as appropriate for your setup:

``` properties
connector.name=kylin
connection-url=jdbc:kylin://example.net/project
connection-user=root
connection-password=secret
connector-planoptimizer-rule-blacklist=io.prestosql.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy
```

The connector-planoptimizer-rule-blacklist attribute is specially configured for kylin, and the default value is io.prestosql.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy

Multiple Kylin Servers
----------------------

You can have as many catalogs as you need, so if you have additional Kylin servers, simply add another properties file to `etc/catalog` with a different name (making sure it ends in `.properties`). For example, if
you name the property file `sales.properties`, openLooKeng will create a catalog named `sales` using the configured connector.

Querying Kylin
--------------

you can access the `clicks` table in the `web` database:

SELECT * FROM Kylin.web.clicks;

If you used a different name for your catalog properties file, use that catalog name instead of `Kylin` in the above examples.

Kylin Connector Limitations
---------------------------

The following SQL statements are not yet supported:

[DELETE](../sql/insert.md)、../sql/update.md)、../sql/delete.md)、[GRANT](../sql/grant.md)[REVOKE](../sql/revoke.md)[SHOW GRANTS](../sql/show-grants.md)[SHOW ROLES](../sql/show-roles.md)[SHOW ROLE GRANTS](../sql/show-role-grants.md)
1 change: 1 addition & 0 deletions hetu-docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ headless: true
- [TPCDS]({{< relref "./docs/connector/tpcds.md" >}})
- [TPCH]({{< relref "./docs/connector/tpch.md" >}})
- [VDM]({{< relref "./docs/connector/vdm.md" >}})
- [Kylin]({{< relref "./docs/connector/kylin.md" >}})

- [Functions and Operators]("#")
- [Logical Operators]({{< relref "./docs/functions/logical.md" >}})
Expand Down
36 changes: 36 additions & 0 deletions hetu-docs/zh/connector/kylin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# Kylin连接器

Kylin连接器允许在外部Kylin数据库中查询表。这可用于在Kylin和Hive等不同系统之间或在两个不同的Kylin实例之间联接数据。

## 配置

要配置Kylin连接器,在`etc/catalog`中创建一个目录属性文件,例如`Kylin.properties`,将Kylin连接器挂载为`kylin`目录。使用以下内容创建文件,并根据设置替换连接属性:

``` properties
connector.name=kylin
connection-url=jdbc:kylin://example.net/project
connection-user=root
connection-password=secret
connector-planoptimizer-rule-blacklist=io.prestosql.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy
```

其中connector-planoptimizer-rule-blacklist属性是对kylin特殊配置的,默认值就为io.prestosql.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy

### 多个Kylin服务器

可以根据需要创建任意多的目录,因此,如果有额外的Kylin服务器,只需添加另一个不同名称的属性文件到`etc/catalog`中(确保它以`.properties`结尾)。例如,如果将属性文件命名为`sales.properties`,openLooKeng将使用配置的连接器创建一个名为`sales`的目录。

## 查询Kylin

可以访问`web`数据库中`clicks`的表:

SELECT * FROM kylin.web.clicks;

如果对目录属性文件使用不同的名称,请使用该目录名称,而不要使用上述示例中的`kylin`

## Kylin连接器限制

暂不支持以下SQL语句:

[DELETE](../sql/insert.md)、../sql/update.md)、../sql/delete.md)、[GRANT](../sql/grant.md)[REVOKE](../sql/revoke.md)[SHOW GRANTS](../sql/show-grants.md)[SHOW ROLES](../sql/show-roles.md)[SHOW ROLE GRANTS](../sql/show-role-grants.md)
1 change: 1 addition & 0 deletions hetu-docs/zh/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ headless: true
- [TPCDS]({{< relref "./docs/connector/tpcds.md" >}})
- [TPCH]({{< relref "./docs/connector/tpch.md" >}})
- [VDM]({{< relref "./docs/connector/vdm.md" >}})
- [Kylin]({{< relref "./docs/connector/kylin.md" >}})

- [函数和运算符]("#")
- [逻辑运算符]({{< relref "./docs/functions/logical.md" >}})
Expand Down
Loading

0 comments on commit de66ed1

Please sign in to comment.