Search before asking
Paimon version
1.4.2
Compute Engine
Flink
Minimal reproduce step
Reproduction SQL verified with sql-client:
-
Create table with option 'table-read.sequence-number.enabled' = 'true'
CREATE TABLE user_role (
id INT,
user_id INT,
role_id INT
) WITH (
'table-read.sequence-number.enabled' = 'true'
);
-
Insert test data
INSERT INTO user_role VALUES (1,1,2),(3,3,5),(5,2,4);
-
Query audit log system table
SELECT * FROM user_role$audit_log;
+---------+------------------+----+---------+---------+
| rowkind | _SEQUENCE_NUMBER | id | user_id | role_id |
+---------+------------------+----+---------+---------+
| +I | 8 | 1 | 1 | 2 |
| +I | 10 | 3 | 3 | 5 |
| +I | 7 | 5 | 2 | 4 |
+---------+------------------+----+---------+---------+
-
Query base table again
SELECT * FROM user_role;
+----+---------+---------+
| id | user_id | role_id |
+----+---------+---------+
| 8 | 1 | 1 |
| 10 | 3 | 3 |
| 7 | 5 | 2 |
+----+---------+---------+
You can also create a table with STRING column to trigger ClassCastException.
What doesn't meet your expectations?
Observed Behavior
- Numeric column table: base table query columns are misaligned. The value of
_SEQUENCE_NUMBER leaks into the first column, all data columns shift right.
- Table contains STRING column: Throw ClassCastException
HeapLongVector cannot be cast to BytesColumnVector
Expected Behavior
After querying $audit_log, querying the base table should return normal data without extra _SEQUENCE_NUMBER column, column order consistent with table schema.
Root Cause
AuditLogTable constructor directly mutates wrapped FileStoreTable's shared options map in-place:
this.wrapped.options().put(KEY_VALUE_SEQUENCE_NUMBER_ENABLED.key(), "true");
### Anything else?
_No response_
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
Search before asking
Paimon version
1.4.2
Compute Engine
Flink
Minimal reproduce step
Reproduction SQL verified with sql-client:
Create table with option 'table-read.sequence-number.enabled' = 'true'
CREATE TABLE user_role (
id INT,
user_id INT,
role_id INT
) WITH (
'table-read.sequence-number.enabled' = 'true'
);
Insert test data
INSERT INTO user_role VALUES (1,1,2),(3,3,5),(5,2,4);
Query audit log system table
SELECT * FROM user_role$audit_log;
+---------+------------------+----+---------+---------+
| rowkind | _SEQUENCE_NUMBER | id | user_id | role_id |
+---------+------------------+----+---------+---------+
| +I | 8 | 1 | 1 | 2 |
| +I | 10 | 3 | 3 | 5 |
| +I | 7 | 5 | 2 | 4 |
+---------+------------------+----+---------+---------+
Query base table again
SELECT * FROM user_role;
+----+---------+---------+
| id | user_id | role_id |
+----+---------+---------+
| 8 | 1 | 1 |
| 10 | 3 | 3 |
| 7 | 5 | 2 |
+----+---------+---------+
You can also create a table with STRING column to trigger ClassCastException.
What doesn't meet your expectations?
Observed Behavior
_SEQUENCE_NUMBERleaks into the first column, all data columns shift right.HeapLongVector cannot be cast to BytesColumnVectorExpected Behavior
After querying $audit_log, querying the base table should return normal data without extra
_SEQUENCE_NUMBERcolumn, column order consistent with table schema.Root Cause
AuditLogTable constructor directly mutates wrapped FileStoreTable's shared options map in-place: