Skip to content

Commit 420efa8

Browse files
doc: Explain the different Alias types and use cases
Signed-off-by: Andreas Reichel <[email protected]>
1 parent 4814ccd commit 420efa8

File tree

1 file changed

+9
-0
lines changed
  • src/main/java/net/sf/jsqlparser/expression

1 file changed

+9
-0
lines changed

src/main/java/net/sf/jsqlparser/expression/Alias.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
import net.sf.jsqlparser.schema.MultiPartName;
2121
import net.sf.jsqlparser.statement.create.table.ColDataType;
2222

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

2534
private String name;

0 commit comments

Comments
 (0)