spark, scala & jdbc - how to limit number of records

前端 未结 3 1716
春和景丽
春和景丽 2021-01-27 04:42

Is there a way to limit the number of records fetched from the jdbc source using spark sql 2.2.0?

I am dealing with a task of moving (and transforming) a large number of

3条回答
  •  情话喂你
    2021-01-27 05:00

    To limit the number of downloaded rows, a SQL query can be used instead of the table name in "dbtable". Description in documentation.

    In query "where" condition can be specified, for example, with server specific features to limit the number of rows (like "rownum" in Oracle).

提交回复
热议问题