Skip to content

Commit 38b0252

Browse files
committed
Fix column name mismatch in multi-table CDC demo
- Fix UNRESOLVED_COLUMN error for user_id column in silver_transactions table - Update SQL query to use correct columns: id, amount, item_count - Remove references to non-existent columns: user_id, currency, transaction_type - Ensure query matches actual silver table schema
1 parent affc923 commit 38b0252

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

product_demos/cdc-pipeline/02-CDC-CDF-full-multi-tables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,15 +690,15 @@ def get_all_table_sizes():
690690
print(f" ID: {row['id']}, User: {row['name']}, Email: {row['email']}")
691691

692692
latest_transactions = spark.sql("""
693-
SELECT id, user_id, amount, currency, transaction_type
693+
SELECT id, amount, item_count
694694
FROM silver_transactions
695695
ORDER BY id DESC
696696
LIMIT 2
697697
""").collect()
698698
if latest_transactions:
699699
print(" 💳 Latest Transactions:")
700700
for row in latest_transactions:
701-
print(f" ID: {row['id']}, User: {row['user_id']}, Amount: {row['amount']} {row['currency']}")
701+
print(f" ID: {row['id']}, Amount: {row['amount']}, Items: {row['item_count']}")
702702

703703
except Exception as e:
704704
print(f" ⚠️ Error showing details: {e}")

0 commit comments

Comments
 (0)