Spark SQL 代码格式化,用于Superior数据中台 Studio SQL 格式化
<dependency>
<groupId>io.github.melin</groupId>
<artifactId>superior-sql-formatter</artifactId>
<version>0.9.5</version>
</dependency>
export GPG_TTY=$(tty) mvn clean deploy -Prelease
val sql = "select distinct name, age from users as t limit 10;"
val formatSql = SparkSqlFormatter.formatSql(sql)
val expected = """
|SELECT DISTINCT
| name,
| age
|FROM users AS t
|LIMIT 10
""".trimMargin()