GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [BUG] JSQLParser Version 5.1-SNAPSHOT: Lateral View with two aliases recognizes second alias as table · Issue #2088 · JSQLParser/JSqlParser

[BUG] JSQLParser Version 5.1-SNAPSHOT: Lateral View with two aliases recognizes second alias as table #2088

New issue
Copy link
New issue
Copy link
Closed
Closed
[BUG] JSQLParser Version 5.1-SNAPSHOT: Lateral View with two aliases recognizes second alias as table#2088
Copy link

Description

@arodriguezdlc
arodriguezdlc
opened on Oct 16, 2024
Issue body actions

Failing SQL Feature:

When using a LATERAL VIEW with two aliases, the second alias is incorrectly being interpreted as a JOIN with a table. Instead, it should be detected as a second alias for the exploded data.

The LateralView class currently has a method getColumnAlias that returns only one alias. This behavior could be incorrect because in cases where there are multiple aliases, such as with exploded arrays or maps, the method should return a list of aliases, not just one.

SQL Example:

SELECT k, v 
FROM table 
LATERAL VIEW EXPLODE(a) exploded_data AS k, v;

In this query, the alias k is correctly detected as the first alias for the exploded data. However, the alias v is mistakenly identified as a table named v, instead of being treated as the second alias for the exploded data.

The expected behavior is that both k and v should be recognized as aliases for the exploded data, with no table join implied.

Software Information:

  • JSqlParser version: 5.1-SNAPSHOT
  • Database: Spark SQL
Reacted by Oscar Bonilla Gonzalez

Activity

  1. manticore-projects commented on Oct 18, 2024

    @manticore-projects
    manticore-projects
    on Oct 18, 2024
    Contributor
    More actions

    Greetings!

    Would that not be a Struct based Alias? We support this already, but not in the form of a plain comma separated column list.
    We support compound aliases like A(k,v).

  2. manticore-projects
    closed this as completedin 4814ccdon Oct 18, 2024
  3. manticore-projects commented on Oct 18, 2024

    @manticore-projects
    manticore-projects
    on Oct 18, 2024
    Contributor
    More actions

    A bit quick and dirty, but it works now. Cheers!

  4. arodriguezdlc commented on Oct 18, 2024

    @arodriguezdlc
    arodriguezdlc
    on Oct 18, 2024
    Author
    More actions

    Thank you @manticore-projects !! We are testing with the new snapshot. Any plans for a 5.1 release? Cheers!

  5. pull
    added a commit that references this issue on Oct 19, 2024

    feat: `LATERAL VIEW` supports multiple alias columns

    This issue will close once commit 4814ccd is merged into the 'master' branch.
    4814ccd
  6. manticore-projects
    added a commit that references this issue on Aug 7, 2026

    fix: allow arbitrary column aliases in LATERAL VIEW (#2452)

    f92f5e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.