Skip to content

Commit

Permalink
Give column a name
Browse files Browse the repository at this point in the history
Some databases require columns to be named under some conditions. For
example, SQL Servers require this in subqueries.
  • Loading branch information
findepi committed Jan 22, 2021
1 parent db906c3 commit 4abdb48
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -147,7 +147,7 @@ protected String getRelation(RemoteTableName remoteTableName)
protected String getProjection(List<JdbcColumnHandle> columns)
{
if (columns.isEmpty()) {
return "1";
return "1 x";
}
return columns.stream()
.map(jdbcColumnHandle -> format("%s AS %s", jdbcColumnHandle.toSqlExpression(client::quoted), client.quoted(jdbcColumnHandle.getColumnName())))
Expand Down

0 comments on commit 4abdb48

Please sign in to comment.