- 14604 Views
- 2 replies
- 1 kudos
I have python variable created under %python in my jupyter notebook file in Azure Databricks. How can I access the same variable to make comparisons under %sql. Below is the example:%python
RunID_Goal = sqlContext.sql("SELECT CONCAT(SUBSTRING(RunID,...
- 14604 Views
- 2 replies
- 1 kudos
Latest Reply
You can use {} in spark.sql() of pyspark/scala instead of making a sql cell using %sql.This will result in a dataframe. If you want you can create a view on top of this using createOrReplaceTempView()Below is an example to use a variable:-# A variab...
1 More Replies
- 38464 Views
- 15 replies
- 0 kudos
Here is the error that I am getting when I run the following query
statement=sqlContext.sql("SELECT count(*) FROM ARDATA_2015_09_01").show()
---------------------------------------------------------------------------Py4JJavaError Traceback (most rec...
- 38464 Views
- 15 replies
- 0 kudos
Latest Reply
192.168.o.1 is a private IP address used to login the admin panel of a router. 192.168.l.l is the host address to change default router settings.
14 More Replies
- 14743 Views
- 6 replies
- 0 kudos
Hi All,
I am trying to convert a dataframe column which is in the format of string to date type format yyyy-MM-DD?
I have written a sql query and stored it in dataframe.
df3 = sqlContext.sql(sqlString2)
df3.withColumn(df3['CalDay'],pd.to_datetime(df...
- 14743 Views
- 6 replies
- 0 kudos
Latest Reply
Registered to post this so forgive the formatting nightmare
This is a python databricks script function that allows you to convert from string to datetime or date and utilising coalescefrom pyspark.sql.functions import coalesce, to_date
def to_dat...
5 More Replies