-
Notifications
You must be signed in to change notification settings - Fork 199
fix(ibis): added primary key management on postgres and updated mssql and mysql to manage composite keys #1106
Changes from 7 commits
e159f5a
0b5eb0a
bfcd4ed
8076da8
7bcce3b
dbff7d8
592ed28
3238116
2337028
feb19ba
10fc6f6
a119b55
43cef18
7c8ed81
721d978
e6e7c02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ def get_table_list(self) -> list[Table]: | |
| catalog=row["table_catalog"], | ||
| table=row["table_name"], | ||
| ), | ||
| primaryKey="", | ||
| primaryKey=[], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainInitialization changed but no logic to populate primary keys The change from initializing This change may be incomplete without corresponding logic to populate the primary key list. Please verify if Trino supports retrieving primary key information and, if so, update either the SQL query in 🏁 Script executed: #!/bin/bash
# Check how primary keys are handled in other metadata modules
echo "Looking at how other metadata modules handle primary keys..."
echo "==============================================="
# Look for primaryKey initialization and population in other metadata modules
echo "Checking primaryKey initialization in other metadata modules:"
rg -A 1 "primaryKey\s*=\s*\[\]" ibis-server/app/model/metadata/
echo "==============================================="
# Look for code that populates primary keys in other modules
echo "Checking how primary keys are populated in other modules:"
rg -A 10 "\.primaryKey\.append" ibis-server/app/model/metadata/
echo "==============================================="
# Check the Table class definition in dto.py to verify the type change
echo "Examining Table class definition in dto.py:"
rg -A 20 "class Table" ibis-server/app/model/metadata/dto.py
echo "==============================================="
# Check the failing test to understand requirements
echo "Looking for trino test file mentioned in PR comments:"
fd "test_trino.py" ibis-server/ --exec cat {}Length of output: 20170 Action Required: Address Missing Primary Key Population for TRINO The TRINO metadata module now initializes
|
||
| ) | ||
|
|
||
| # table exists, and add column to the table | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,7 +66,7 @@ | |
| "type": "timestamp", | ||
| }, | ||
| ], | ||
| "primaryKey": "orderkey", | ||
| "primaryKey": ["orderkey"], | ||
| }, | ||
| ], | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ | |
| "type": "varchar", | ||
| }, | ||
| ], | ||
| "primaryKey": "orderkey", | ||
| "primaryKey": ["orderkey"], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify all test assertions are compatible with the new primary key format. While the primary key format changes look good, it's important to ensure that any assertions or validations in the test suite that might reference these primary keys are also updated to expect lists instead of strings. Also applies to: 69-69 🏁 Script executed: #!/bin/bash
# Scan for assertions or validations that might expect primaryKey to be a string
rg -A 5 -B 5 "primaryKey" --glob "*.py" | grep -E "assert|test" | grep -v "\[\".*\"\]"Length of output: 30078 Attention: Update Test Assertions for Primary Key Format Change The primary key update in
Please update the tests accordingly to prevent potential mismatches and unexpected behavior during test execution. |
||
| }, | ||
| { | ||
| "name": "Customer", | ||
|
|
@@ -66,7 +66,7 @@ | |
| "expression": "sum(orders.totalprice)", | ||
| }, | ||
| ], | ||
| "primaryKey": "custkey", | ||
| "primaryKey": ["custkey"], | ||
| }, | ||
| ], | ||
| "relationships": [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ | |
| "type": "bytea", | ||
| }, | ||
| ], | ||
| "primaryKey": "orderkey", | ||
| "primaryKey": ["orderkey"], | ||
| }, | ||
| ], | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ | |
| "type": "blob", | ||
| }, | ||
| ], | ||
| "primaryKey": "orderkey", | ||
| "primaryKey": ["orderkey"], | ||
| } | ||
| ], | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ | |
| "type": "timestamp", | ||
| }, | ||
| ], | ||
| "primaryKey": "orderkey", | ||
| "primaryKey": ["orderkey"], | ||
| }, | ||
| ], | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,7 +59,7 @@ | |
| "type": "bytea", | ||
| }, | ||
| ], | ||
| "primaryKey": "orderkey", | ||
| "primaryKey": ["orderkey"], | ||
| }, | ||
| ], | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ | |
| "type": "timestamptz", | ||
| }, | ||
| ], | ||
| "primaryKey": "o_orderkey", | ||
| "primaryKey": ["o_orderkey"], | ||
| }, | ||
| ], | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the comment propose? Could you explain more?