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

Add EXCLUDE test for a new projection from subquery #1394

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

am357
Copy link
Contributor

@am357 am357 commented Mar 20, 2024

Relevant Issues

  • [Closes/Related To] Issue #XXX

Description

Adds a unit-test for excluding an attribute that is as a result of a new projection from a sub-query.

More details:

PartiQL> SELECT tbl2.* EXCLUDE tbl2.dervidedColumn FROM (SELECT tbl1.*, tbl1.a.b + 2 AS dervidedColumn FROM <<{'a': {'b': 2}, 'foo': 'bar', 'foo2': 'bar2'}>> AS tbl1) AS tbl2;
==='
<<
  {
    'a': {
      'b': 2
    },
    'foo': 'bar',
    'foo2': 'bar2'
  }
>>
---
OK!
PartiQL> SELECT tbl2.* FROM (SELECT tbl1.*, tbl1.a.b + 2 AS dervidedColumn FROM <<{'a': {'b': 2}, 'foo': 'bar', 'foo2': 'bar2'}>> AS tbl1) AS tbl2;
==='
<<
  {
    'a': {
      'b': 2
    },
    'foo': 'bar',
    'foo2': 'bar2',
    'dervidedColumn': 4
  }
>>
---
OK!

Other Information

  • Updated Unreleased Section in CHANGELOG: [YES/NO]

    • No, this is just a uni-test addition.
  • Any backward-incompatible changes? [YES/NO]

    • No.
  • Any new external dependencies? [YES/NO]

    • No.
  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? [YES/NO]

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Adds a unit-test for excluding a column that is as a result of a new projection from a subquery.

More details:
```
PartiQL> SELECT tbl2.* EXCLUDE tbl2.dervidedColumn FROM (SELECT tbl1.*, tbl1.a.b + 2 AS dervidedColumn FROM <<{'a': {'b': 2}, 'foo': 'bar', 'foo2': 'bar2'}>> AS tbl1) AS tbl2;
==='
<<
  {
    'a': {
      'b': 2
    },
    'foo': 'bar',
    'foo2': 'bar2'
  }
>>
---
OK!
PartiQL> SELECT tbl2.* FROM (SELECT tbl1.*, tbl1.a.b + 2 AS dervidedColumn FROM <<{'a': {'b': 2}, 'foo': 'bar', 'foo2': 'bar2'}>> AS tbl1) AS tbl2;
==='
<<
  {
    'a': {
      'b': 2
    },
    'foo': 'bar',
    'foo2': 'bar2',
    'dervidedColumn': 4
  }
>>
---
OK!
```
@am357 am357 requested a review from alancai98 March 20, 2024 17:11
Copy link

Conformance comparison report

Base (a18e8e0) ec308f9 +/-
% Passing 92.54% 92.54% 0.00%
✅ Passing 5384 5384 0
❌ Failing 434 434 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5384

Number failing in both: 434

Number passing in Base (a18e8e0) but now fail: 0

Number failing in Base (a18e8e0) but now pass: 0

@am357 am357 merged commit 5bcde13 into main Mar 20, 2024
10 checks passed
@am357 am357 deleted the test-exclude-subquery-derived-col branch March 20, 2024 20:35
rchowell pushed a commit that referenced this pull request Apr 2, 2024
Adds a unit-test for excluding a column that is as a result of a new projection from a subquery.

More details:
```
PartiQL> SELECT tbl2.* EXCLUDE tbl2.dervidedColumn FROM (SELECT tbl1.*, tbl1.a.b + 2 AS dervidedColumn FROM <<{'a': {'b': 2}, 'foo': 'bar', 'foo2': 'bar2'}>> AS tbl1) AS tbl2;
==='
<<
  {
    'a': {
      'b': 2
    },
    'foo': 'bar',
    'foo2': 'bar2'
  }
>>
---
OK!
PartiQL> SELECT tbl2.* FROM (SELECT tbl1.*, tbl1.a.b + 2 AS dervidedColumn FROM <<{'a': {'b': 2}, 'foo': 'bar', 'foo2': 'bar2'}>> AS tbl1) AS tbl2;
==='
<<
  {
    'a': {
      'b': 2
    },
    'foo': 'bar',
    'foo2': 'bar2',
    'dervidedColumn': 4
  }
>>
---
OK!
```
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