Skip to content

Commit

Permalink
doc: Explain the different Alias types and use cases
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Reichel <[email protected]>
  • Loading branch information
manticore-projects committed Oct 19, 2024
1 parent 4814ccd commit 420efa8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/net/sf/jsqlparser/expression/Alias.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
import net.sf.jsqlparser.schema.MultiPartName;
import net.sf.jsqlparser.statement.create.table.ColDataType;

/**
* The type Alias for Tables, Columns or Views.
*
* We support three different types:
* 1) Simple String: `SELECT 1 AS "ALIAS"` when NAME is set and aliasColumns has no elements
* 2) UDF Aliases: `SELECT udf(1,2,3) AS "Alias(a,b,c)"` " when NAME!=null and aliasColumns has elements
* 3) Column lists for LATERAL VIEW: `SELECT * from a LATERAL VIEW EXPLODE ... AS a, b, c`, when NAME is NULL and aliasColumns has elements
* @see <a href="https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-lateral-view.html">Spark LATERAL VIEW</a>
*/
public class Alias implements Serializable {

private String name;
Expand Down

0 comments on commit 420efa8

Please sign in to comment.