Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
e7aa5347
Commit
e7aa5347
authored
Dec 10, 2024
by
wangpeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hive-catalog
parent
7b4845af
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
0 deletions
+133
-0
core-site.xml
dinky-admin/src/main/resources/core-site.xml
+29
-0
hdfs-site.xml
dinky-admin/src/main/resources/hdfs-site.xml
+29
-0
hive-site.xml
dinky-admin/src/main/resources/hive-site.xml
+29
-0
IcebergSinkBuilder.java
...c/main/java/org/dinky/cdc/iceberg/IcebergSinkBuilder.java
+20
-0
pom.xml
dinky-flink/dinky-flink-1.16/pom.xml
+26
-0
No files found.
dinky-admin/src/main/resources/core-site.xml
0 → 100644
View file @
e7aa5347
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>
metastore.task.threads.always
</name>
<value>
org.apache.hadoop.hive.metastore.events.EventCleanerTask
</value>
</property>
<property>
<name>
fs.oss.impl
</name>
<value>
org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem
</value>
</property>
<property>
<name>
fs.oss.endpoint.region
</name>
<value>
cn-wulanchabu
</value>
</property>
<property>
<name>
fs.oss.accessKeyId
</name>
<value>
LTAI5tB1jnMHbBZyxrLwgCDD
</value>
</property>
<property>
<name>
fs.oss.accessKeySecret
</name>
<value>
H30ZjuGCZNrMn92dYdQI2nW4P8Uawy
</value>
</property>
<property>
<name>
fs.oss.endpoint
</name>
<value>
oss-cn-wulanchabu.aliyuncs.com
</value>
</property>
</configuration>
\ No newline at end of file
dinky-admin/src/main/resources/hdfs-site.xml
0 → 100644
View file @
e7aa5347
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>
metastore.task.threads.always
</name>
<value>
org.apache.hadoop.hive.metastore.events.EventCleanerTask
</value>
</property>
<property>
<name>
fs.oss.impl
</name>
<value>
org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem
</value>
</property>
<property>
<name>
fs.oss.endpoint.region
</name>
<value>
cn-wulanchabu
</value>
</property>
<property>
<name>
fs.oss.accessKeyId
</name>
<value>
LTAI5tB1jnMHbBZyxrLwgCDD
</value>
</property>
<property>
<name>
fs.oss.accessKeySecret
</name>
<value>
H30ZjuGCZNrMn92dYdQI2nW4P8Uawy
</value>
</property>
<property>
<name>
fs.oss.endpoint
</name>
<value>
oss-cn-wulanchabu.aliyuncs.com
</value>
</property>
</configuration>
\ No newline at end of file
dinky-admin/src/main/resources/hive-site.xml
0 → 100644
View file @
e7aa5347
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>
metastore.task.threads.always
</name>
<value>
org.apache.hadoop.hive.metastore.events.EventCleanerTask
</value>
</property>
<property>
<name>
fs.oss.impl
</name>
<value>
org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem
</value>
</property>
<property>
<name>
fs.oss.endpoint.region
</name>
<value>
cn-wulanchabu
</value>
</property>
<property>
<name>
fs.oss.accessKeyId
</name>
<value>
LTAI5tB1jnMHbBZyxrLwgCDD
</value>
</property>
<property>
<name>
fs.oss.accessKeySecret
</name>
<value>
H30ZjuGCZNrMn92dYdQI2nW4P8Uawy
</value>
</property>
<property>
<name>
fs.oss.endpoint
</name>
<value>
oss-cn-wulanchabu.aliyuncs.com
</value>
</property>
</configuration>
\ No newline at end of file
dinky-cdc/dinky-cdc-core/src/main/java/org/dinky/cdc/iceberg/IcebergSinkBuilder.java
View file @
e7aa5347
...
@@ -5,6 +5,13 @@ import org.apache.flink.streaming.api.datastream.DataStreamSource;
...
@@ -5,6 +5,13 @@ import org.apache.flink.streaming.api.datastream.DataStreamSource;
import
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
;
import
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
;
import
org.apache.flink.table.data.RowData
;
import
org.apache.flink.table.data.RowData
;
import
org.apache.flink.table.types.logical.LogicalType
;
import
org.apache.flink.table.types.logical.LogicalType
;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.iceberg.CatalogProperties
;
import
org.apache.iceberg.catalog.Catalog
;
import
org.apache.iceberg.catalog.Namespace
;
import
org.apache.iceberg.catalog.TableIdentifier
;
import
org.apache.iceberg.flink.CatalogLoader
;
import
org.apache.iceberg.flink.TableLoader
;
import
org.apache.iceberg.hive.HiveCatalog
;
import
org.apache.iceberg.hive.HiveCatalog
;
import
org.dinky.cdc.AbstractSinkBuilder
;
import
org.dinky.cdc.AbstractSinkBuilder
;
import
org.dinky.cdc.CDCBuilder
;
import
org.dinky.cdc.CDCBuilder
;
...
@@ -14,7 +21,9 @@ import org.dinky.data.model.Table;
...
@@ -14,7 +21,9 @@ import org.dinky.data.model.Table;
import
org.dinky.executor.CustomTableEnvironment
;
import
org.dinky.executor.CustomTableEnvironment
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Properties
;
public
class
IcebergSinkBuilder
extends
AbstractSinkBuilder
implements
Serializable
{
public
class
IcebergSinkBuilder
extends
AbstractSinkBuilder
implements
Serializable
{
...
@@ -27,6 +36,17 @@ public class IcebergSinkBuilder extends AbstractSinkBuilder implements Serializa
...
@@ -27,6 +36,17 @@ public class IcebergSinkBuilder extends AbstractSinkBuilder implements Serializa
super
(
config
);
super
(
config
);
}
}
public
static
void
main
(
String
[]
args
)
{
Map
<
String
,
String
>
properties
=
new
HashMap
<>();
properties
.
put
(
CatalogProperties
.
WAREHOUSE_LOCATION
,
"oss://spark-upload-file/datalake/hivemeta-warehouse"
);
properties
.
put
(
CatalogProperties
.
URI
,
"thrift://39.101.70.74:31080"
);
CatalogLoader
catalogLoader
=
CatalogLoader
.
hive
(
"hive_catalog"
,
new
Configuration
(),
properties
);
Catalog
icebergOSSCatalog
=
catalogLoader
.
loadCatalog
();
TableIdentifier
identifier
=
TableIdentifier
.
of
(
Namespace
.
of
(
"iceberg_service_wangwu"
),
"employee"
);
org
.
apache
.
iceberg
.
Table
table
=
icebergOSSCatalog
.
loadTable
(
identifier
);
System
.
out
.
println
(
table
.
name
());
TableLoader
tableLoader
=
TableLoader
.
fromCatalog
(
catalogLoader
,
identifier
);
}
@Override
@Override
public
DataStreamSource
build
(
CDCBuilder
cdcBuilder
,
public
DataStreamSource
build
(
CDCBuilder
cdcBuilder
,
StreamExecutionEnvironment
env
,
StreamExecutionEnvironment
env
,
...
...
dinky-flink/dinky-flink-1.16/pom.xml
View file @
e7aa5347
...
@@ -28,6 +28,32 @@
...
@@ -28,6 +28,32 @@
<artifactId>flink-shaded-hadoop-3-uber</artifactId>
<artifactId>flink-shaded-hadoop-3-uber</artifactId>
<version>3.1.1.7.2.9.0-173-9.0</version>
<version>3.1.1.7.2.9.0-173-9.0</version>
</dependency>-->
</dependency>-->
<dependency>
<groupId>
org.apache.iceberg
</groupId>
<artifactId>
iceberg-flink-runtime-1.16
</artifactId>
<version>
1.5.2
</version>
</dependency>
<dependency>
<groupId>
org.apache.hadoop
</groupId>
<artifactId>
hadoop-aliyun
</artifactId>
<version>
3.3.2
</version>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
<version>
3.17.4
</version>
</dependency>
<dependency>
<groupId>
org.jdom
</groupId>
<artifactId>
jdom2
</artifactId>
<version>
2.0.6
</version>
</dependency>
<!--hive-->
<dependency>
<groupId>
org.apache.flink
</groupId>
<artifactId>
flink-sql-connector-hive-3.1.2_2.12
</artifactId>
<version>
1.16.2
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.flink
</groupId>
<groupId>
org.apache.flink
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment