stackql / stackql/stackql-devel

[BUG] View column aliasing does not work

Open
#47 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug v0.3
Dominant language
Go
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Aliased view columns are not yet supported, as per screen capture.

Screen Shot 2023-01-29 at 10 32 10 am

To Reproduce

This works:

create view cross_cloud_disks1 as
select 'google' as vendor, name, split_part(split_part(type, '/', 11), '-', 2) as type, sizeGb from google.compute.disks where project = 'stackql-demo' and zone = 'australia-southeast1-a'
union
select 'aws' as vendor, volumeId as name, volumeType as type, size as SizeGb from aws.ec2.volumes where region = 'ap-southeast-2' 
;

select * from cross_cloud_disks1;

This does not work:

create view cross_cloud_disks2 as
select 'google' as vendor, name, split_part(split_part(type, '/', 11), '-', 2) as type, sizeGb as size from google.compute.disks where project = 'stackql-demo' and zone = 'australia-southeast1-a'
union
select 'aws' as vendor, volumeId as name, volumeType as type, size from aws.ec2.volumes where region = 'ap-southeast-2' 
;

select * from cross_cloud_disks2;

This simpler view also does not work:

create view cross_cloud_disks3 as
select 'google' as vendor, name, split_part(split_part(type, '/', 11), '-', 2) as type, sizeGb as size from google.compute.disks where project = 'stackql-demo' and zone = 'australia-southeast1-a'
;

select * from cross_cloud_disks3;

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the three SQL view definitions in the issue and compare the working cross_cloud_disks1 query with the aliased columns in cross_cloud_disks2 and cross_cloud_disks3. Trace the view and SELECT handling used by the Go query engine. Done means aliased view columns resolve correctly and all three example queries return the expected results.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.