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

Support alias in SQL API #542

Merged
merged 1 commit into from
Apr 5, 2022
Merged

Support alias in SQL API #542

merged 1 commit into from
Apr 5, 2022

Conversation

brfrn169
Copy link
Collaborator

@brfrn169 brfrn169 commented Apr 4, 2022

This PR supports alias in SQL API.

After this change, we can specify projections with aliases (with the as() method) as follows:

SelectStatement statement =
  StatementBuilder.select(Projection.column("col2").as("a"), Projection.column("col3").as("b"))
      .from("ns", "tbl")
      .where(Predicate.column("col1").isEqualTo(Value.ofInt(10)))
      .and(Predicate.column("col2").isGreaterThan(Value.ofText("aaa")))
      .and(Predicate.column("col2").isLessThan(Value.ofText("ccc")))
      .orderBy(
          ClusteringOrdering.column("col2").desc(), ClusteringOrdering.column("col3").desc())
      .limit(10)
      .build();

Please take a look!

@brfrn169 brfrn169 requested a review from feeblefakie April 4, 2022 12:51
@brfrn169 brfrn169 self-assigned this Apr 4, 2022
@brfrn169 brfrn169 force-pushed the support-alias-in-sql-api branch from 32b09b8 to 3ac08dd Compare April 5, 2022 00:17
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting close to SQ! LGTM! Thank you.

@feeblefakie feeblefakie merged commit b4cf8c8 into master Apr 5, 2022
@feeblefakie feeblefakie deleted the support-alias-in-sql-api branch April 5, 2022 08:23
brfrn169 added a commit that referenced this pull request Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants