|
102 | 102 | "outputs": [], |
103 | 103 | "source": [ |
104 | 104 | "import logging\n", |
105 | | - "logger = spark._jvm.org.apache.log4j\n", |
106 | 105 | "logging.getLogger(\"py4j.java_gateway\").setLevel(logging.ERROR)\n", |
107 | 106 | "logging.getLogger(\"py4j.clientserver\").setLevel(logging.ERROR)" |
108 | 107 | ] |
|
341 | 340 | "rowLimit": 10000 |
342 | 341 | }, |
343 | 342 | "inputWidgets": {}, |
344 | | - "nuid": "2408e75a-7cbe-47c2-8d5a-6c710e1db5fe", |
| 343 | + "nuid": "ab4663c8-9b4b-4945-8317-dd4a5d8afc2e", |
345 | 344 | "showTitle": false, |
346 | 345 | "tableResultSettingsMap": {}, |
347 | 346 | "title": "" |
348 | 347 | } |
349 | 348 | }, |
350 | 349 | "outputs": [], |
351 | 350 | "source": [ |
352 | | - "if n > sc.defaultParallelism:\n", |
353 | | - " sqlContext.setConf(\"spark.sql.shuffle.partitions\", sc.defaultParallelism)" |
| 351 | + "# Get the current value of shuffle partitions\n", |
| 352 | + "current = spark.conf.get(\"spark.sql.shuffle.partitions\")\n", |
| 353 | + "\n", |
| 354 | + "# If not set to 'auto' (serverless), convert to int; otherwise, use default 200\n", |
| 355 | + "if current != \"auto\":\n", |
| 356 | + " current_val = int(current)\n", |
| 357 | + "else:\n", |
| 358 | + " current_val = 200 \n", |
| 359 | + "\n", |
| 360 | + "# If n is greater than the current value, update the shuffle partitions setting\n", |
| 361 | + "if n > current_val: \n", |
| 362 | + " spark.conf.set(\"spark.sql.shuffle.partitions\", str(n))" |
354 | 363 | ] |
355 | 364 | }, |
356 | 365 | { |
|
649 | 658 | ], |
650 | 659 | "metadata": { |
651 | 660 | "application/vnd.databricks.v1+notebook": { |
652 | | - "computePreferences": null, |
| 661 | + "computePreferences": { |
| 662 | + "hardware": { |
| 663 | + "accelerator": null, |
| 664 | + "gpuPoolId": null, |
| 665 | + "memory": null |
| 666 | + } |
| 667 | + }, |
653 | 668 | "dashboards": [], |
654 | | - "environmentMetadata": null, |
| 669 | + "environmentMetadata": { |
| 670 | + "base_environment": "", |
| 671 | + "dependencies": [ |
| 672 | + "/Workspace/Users/[email protected]/many-model-forecasting" |
| 673 | + ], |
| 674 | + "environment_version": "3" |
| 675 | + }, |
655 | 676 | "inputWidgetPreferences": null, |
656 | 677 | "language": "python", |
657 | 678 | "notebookMetadata": { |
|
0 commit comments