Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix case statement exception #100

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Fix case statement exception #100

merged 3 commits into from
Feb 7, 2025

Conversation

jogrogan
Copy link
Collaborator

@jogrogan jogrogan commented Feb 7, 2025

Fix case statements causing a null pointer exception

Example query:

create or replace materialized view ADS."AD_CLICKS$test1" AS SELECT company_name, CASE WHEN company_urn = 'PUBLISHED' THEN NULL ELSE company_urn END FROM PROFILE.COMPANIES;

Result:

- CREATE DATABASE IF NOT EXISTS `PROFILE` WITH ();
- CREATE TABLE IF NOT EXISTS `PROFILE`.`COMPANIES` (`COMPANY_NAME` VARCHAR, `COMPANY_URN` VARCHAR) WITH ('connector'='datagen', 'number-of-rows'='10');
- CREATE DATABASE IF NOT EXISTS `ADS` WITH ();
- CREATE TABLE IF NOT EXISTS `ADS`.`AD_CLICKS` (`CAMPAIGN_URN` VARCHAR, `MEMBER_URN` VARCHAR) WITH ('connector'='blackhole');
- INSERT INTO `ADS`.`AD_CLICKS` (`COMPANY_NAME`, `EXPR_1`) SELECT `COMPANY_NAME`, CASE WHEN `COMPANY_URN` = 'PUBLISHED' THEN NULL ELSE `COMPANY_URN` END FROM `PROFILE`.`COMPANIES`;

Also fixes various checkstyle complaints and adds missing key properties to kafka yaml

@jogrogan jogrogan force-pushed the jogrogan/caseStatement branch from 58931aa to 377439e Compare February 7, 2025 16:37
@jogrogan jogrogan enabled auto-merge (squash) February 7, 2025 16:41
@jogrogan jogrogan merged commit aeb8b20 into main Feb 7, 2025
1 check passed
@jogrogan jogrogan deleted the jogrogan/caseStatement branch February 7, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants