You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2023/01/20 04:38:21 UTC
[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #39660: [SPARK-42128][SQL] Support TOP (N) for MS SQL Server dialect as an alternative to Limit pushdown
dongjoon-hyun commented on code in PR #39660:
URL: https://github.com/apache/spark/pull/39660#discussion_r1082103024
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/MsSqlServerDialect.scala:
##########
@@ -167,10 +167,15 @@ private object MsSqlServerDialect extends JdbcDialect {
throw QueryExecutionErrors.commentOnTableUnsupportedError()
}
+ // SQL Server does not support, it uses `getTopExpression` instead.
override def getLimitClause(limit: Integer): String = {
""
}
+ override def getTopExpression(limit: Integer): String = {
+ if (limit > 0) s"TOP ($limit)" else ""
Review Comment:
Just curious, MsSQL syntax doesn't allow `TOP 0`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org