Giter VIP home page Giter VIP logo

Comments (7)

gaydba avatar gaydba commented on September 24, 2024

same here #41267 (comment)

from starrocks.

stephen-shelby avatar stephen-shelby commented on September 24, 2024

hi, what's your starrocks version?

from starrocks.

mlbzssk avatar mlbzssk commented on September 24, 2024

same here #41267 (comment)

same here #41267 (comment)

Thanks! I will go study

from starrocks.

mlbzssk avatar mlbzssk commented on September 24, 2024

hi, what's your starrocks version?

The starrocks version is 3.1.10

from starrocks.

stephen-shelby avatar stephen-shelby commented on September 24, 2024

@mlbzssk hi, how do you upsert your table. could you share the reproduce process? I can't reproduce the issue using 3.1.10

from starrocks.

mlbzssk avatar mlbzssk commented on September 24, 2024

@mlbzssk hi, how do you upsert your table. could you share the reproduce process? I can't reproduce the issue using 3.1.10
@gaydba
@stephen-shelby
I also use the 3.1.10。
As i can see, this problem similar to apache/iceberg#6153
And the version which I use have the patch #41267 (comment).
the reproduce procedure is like:
1、create a mysql table,insert some data
create table mysql_table(id int primary key ,addr varchar(50),ts varchar(50) );
insert into mysql_table values(1,"aaa","2024-04-30");
insert into mysql_table values(2,"bb","2024-04-30");
insert into mysql_table values(3,"ccc","2024-04-30");
2、use spark-sql create a table with not primary key
CREATE TABLE spark_table (
id int,
addr string,
ts string) USING iceberg PARTITIONED BY (ts)
TBLPROPERTIES('format-version'='2', 'write.upsert.enabled'='true');
3、use flink sql create 2 tables
CREATE TABLE default_catalog.default_database.flink_table_to_mysql (
id int,
addr string,
ts string,
PRIMARY KEY(id) NOT ENFORCED
) WITH (
'connector' = 'mysql-cdc',
'hostname' = '',
'port' = '',
'username' = '',
'password' = '',
'database-name' = 'iceberg_query_data',
'table-name' = 'mysql_table'
);

CREATE TABLE flink_table_to_spark (
id INT COMMENT 'unique id',
addr STRING NOT NULL,
ts string,
PRIMARY KEY(id,ts) NOT ENFORCED
) PARTITIONED BY (ts)
WITH (
'connector'='iceberg',
'catalog-name'='hive_prod',
'catalog-database'='default',
'catalog-table'='spark_table',
'uri'='thrift://',
'warehouse'='hdfs://'
);
4、let the data flow from default_catalog.default_database.flink_table_to_mysql to flink_table_to_spark
INSERT INTO
flink_table_to_spark /*+ OPTIONS('upsert-enabled'='true') */
SELECT * from default_catalog.default_database.flink_table_to_mysql;
5、update one row data in mysql
update mysql_table set addr='hahahaha' where id = '1';
6、query the data with starrocks and spark,you will find the result of the starrocks have 2 rows,but the spark only have 1 row.
CREATE EXTERNAL CATALOG hive_catalog_iceberg
PROPERTIES
(
"type" = "iceberg",
"iceberg.catalog.type" = "hive",
"hive.metastore.uris" = "thrift://"
);

from starrocks.

stephen-shelby avatar stephen-shelby commented on September 24, 2024

resolved

from starrocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.