What does the command df.registerTempTable() do?

0 votes

What does this command does, is to just register an empty table with no columns?

df.registerTempTable(“airports”)  

I read a csv file with test data I got the message that the table is being stored in HiveMetaStore. Is it a correct understanding that the way we created the table is not a Spark Temp View but a Hive table? If so, can we change the path of the HiveMetastore to a different value where I am keeping other Hive Tables?

image.png

Also, when I say show table, now I see that against "sal2" table "isTemporary" is set to False. Does this mean that this table will be available even to other sessions plus will be there even I close the session?

image.png

6 days ago in Apache Spark by ophelia
19 views

1 answer to this question.

0 votes
df.registerTempTable(“airports”) 

This command is used to register the dataframe df as a temporary table airports so that we are able to query the table.

Here, df is a dataframe which you need to create and airports are the temporary table.

image.pngyou are getting an error in the screenshot. Please refer to the below screenshot:

image

image
Also, yes if temporary is set to false, means that the table will be available even after you close the session. The table is not temporary.

answered 6 days ago by James

Related Questions In Apache Spark

0 votes
1 answer

What does reduce action do in Spark?

Hey, Reduce action converts an RDD to a ...READ MORE

answered Jul 4 in Apache Spark by Gitika
• 19,720 points
10 views
0 votes
1 answer

What is the difference between Apache Spark SQLContext vs HiveContext?

Spark 2.0+ Spark 2.0 provides native window functions ...READ MORE

answered May 25, 2018 in Apache Spark by nitinrawat895
• 10,110 points
1,668 views
0 votes
1 answer

What are the parameters in local[a,b,c] explains?

SparkContext.createTaskScheduler property parses the master parameter Local: 1 ...READ MORE

answered May 29, 2018 in Apache Spark by Shubham
• 13,190 points
59 views
0 votes
1 answer

What do we mean by an RDD in Spark?

The full form of RDD is a ...READ MORE

answered Jun 18, 2018 in Apache Spark by nitinrawat895
• 10,110 points
126 views
+1 vote
3 answers

What is the difference between rdd and dataframes in Apache Spark ?

Comparison between Spark RDD vs DataFrame 1. Release ...READ MORE

answered Aug 27, 2018 in Apache Spark by shams
• 3,580 points
10,101 views
0 votes
0 answers
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,110 points
2,046 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,110 points
196 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
10,476 views
0 votes
1 answer