Я пытаюсь получить топ-5 поставщиков по столбцу итоговых счетов в порядке c, но, похоже, он не работает.
Вот моя схема и набор данных.
root
|-- InvoiceVendorName: string (nullable = true)
|-- TotalInvoice: double (nullable = true)
+--------------------+--------------------+
| InvoiceVendorName| TotalInvoice|
+--------------------+--------------------+
|UCSD/SHARP HEALTH...| 4.340777221E7|
|MEDLINE INDUSTRIE...|3.5532045550000355E7|
|CROSS COUNTRY TRA...| 2.035726783999999E7|
| EPIC SYSTEMS CORP| 1.3199249E7|
|ASD SPECIALTY HEA...|1.2504829989999998E7|
|JURISDICTION D DM...| 1.1998333E7|
|BLUE CROSS OF CAL...|1.1179388599999998E7|
|AMERICAN NATIONAL...| 8414052.699999997|
| BANC OF AMERICA| 7986946.8100000005|
|EPLUS TECHNOLOGY,...| 6659258.84|
|DEPUY SYNTHES SAL...| 5193524.240000001|
|BOSTON SCIENTIFI...| 5034415.02|
|ALEXANDRIA REAL E...| 4693296.75|
|ROCHE DIAGNOSTIC ...| 4687701.74|
| CDR ASSOCIATES, LLC| 4073132.3400000036|
|ALVAREZ & MARSAL ...| 3951250.0|
| ST. JUDE MEDICAL| 3685824.3499999996|
|OPTIMUM HEALTHCAR...| 3493656.8900000006|
| NUVASIVE, INC| 3355898.239999999|
|EDWARDS LIFESCIEN...| 3314977.11|
+--------------------+--------------------+
Я пробовал ниже запрос, но ни один из них не работал.
top_vendor_invoices.orderBy(org.apache.spark.sql.functions.col("TotalInvoice").desc).show()
Или
top_vendor_invoices.orderBy(desc("TotalInvoice")).show()