Format: application/octet-stream
⬇ Download File (2.3 KB)
   1  {
   2   "cells": [
   3    {
   4     "cell_type": "code",
   5     "execution_count": 3,
   6     "id": "38b82487-ad69-4906-b484-d18212aada5c",
   7     "metadata": {},
   8     "outputs": [
   9      {
  10       "data": {
  11        "application/vnd.jupyter.widget-view+json": {
  12         "model_id": "",
  13         "version_major": 2,
  14         "version_minor": 0
  15        },
  16        "text/plain": [
  17         "FloatProgress(value=0.0, bar_style='info', description='Progress:', layout=Layout(height='25px', width='50%'),…"
  18        ]
  19       },
  20       "metadata": {},
  21       "output_type": "display_data"
  22      }
  23     ],
  24     "source": [
  25      "#from helper.credentials import *\n",
  26      "#from helper.dataextractor import *\n",
  27      "from pyspark.sql import SparkSession\n",
  28      "from pyspark.sql.functions import *\n",
  29      "import datetime\n",
  30      "from pyspark import SparkContext\n",
  31      "#spark.stop()\n",
  32      "common ='/driver/'\n",
  33      "path1='snowflake-jdbc-3.13.26.jar'\n",
  34      "path2='spark-snowflake_2.13-2.11.1-spark_3.3.jar'\n",
  35      "p=path1+','+path2\n",
  36      "spark = SparkSession.builder \\\n",
  37      "                    .config('spark.jars', p) \\\n",
  38      "                    .appName('dev') \\\n",
  39      "                    .getOrCreate()"
  40     ]
  41    },
  42    {
  43     "cell_type": "code",
  44     "execution_count": null,
  45     "id": "3ced2222-4feb-4895-b467-68b8a067ae5c",
  46     "metadata": {},
  47     "outputs": [
  48      {
  49       "data": {
  50        "application/vnd.jupyter.widget-view+json": {
  51         "model_id": "82030ce371704997ac7456e752d15794",
  52         "version_major": 2,
  53         "version_minor": 0
  54        },
  55        "text/plain": [
  56         "FloatProgress(value=0.0, bar_style='info', description='Progress:', layout=Layout(height='25px', width='50%'),…"
  57        ]
  58       },
  59       "metadata": {},
  60       "output_type": "display_data"
  61      }
  62     ],
  63     "source": [
  64      "spark.sql('select * from assortment_dev.assortment_dev')"
  65     ]
  66    },
  67    {
  68     "cell_type": "code",
  69     "execution_count": null,
  70     "id": "b525398d-0ba1-4116-8f14-b1a44397b137",
  71     "metadata": {},
  72     "outputs": [],
  73     "source": []
  74    }
  75   ],
  76   "metadata": {
  77    "kernelspec": {
  78     "display_name": "PySpark",
  79     "language": "python",
  80     "name": "pysparkkernel"
  81    },
  82    "language_info": {
  83     "codemirror_mode": {
  84      "name": "python",
  85      "version": 3
  86     },
  87     "file_extension": ".py",
  88     "mimetype": "text/x-python",
  89     "name": "pyspark",
  90     "pygments_lexer": "python3"
  91    }
  92   },
  93   "nbformat": 4,
  94   "nbformat_minor": 5
  95  }
  96