Category "hive"

SparkSQL error: collect_set() cannot have map type data

For SparkSQL on hive, when I used named_struct in the query, it returns results: SELECT id, collect_set(emp_info) as employee_info FROM ( SELECT t.id,

Save Spark dataframe as dynamic partitioned table in Hive

I have a sample application working to read from csv files into a dataframe. The dataframe can be stored to a Hive table in parquet format using the method df.

output/echo a meesage in hql/ hive query language

I need to create a hive.hql as follows. HIVE.hql: select * from tabel1; select * from table2; My question is: can i echo any message to my console like " re

reading and writing from hive tables with spark after aggregation

We have a hive warehouse, and wanted to use spark for various tasks (mainly classification). At times write the results back as a hive table. For example, we wr

Cannot connect to hive using beeline, user root cannot impersonate anonymous

I'm trying to connect to hive using beeline !connect jdbc:hive2://localhost:10000 and I'm being asked for a username and password Connecting to jdbc:hive2://l

Pandas dataframe in pyspark to hive

How to send a pandas dataframe to a hive table? I know if I have a spark dataframe, I can register it to a temporary table using df.registerTempTable("table_

Pandas dataframe in pyspark to hive

How to send a pandas dataframe to a hive table? I know if I have a spark dataframe, I can register it to a temporary table using df.registerTempTable("table_

Access Hive Data from Java

I need to acces the data in Hive, from Java.According to the documentation for Hive JDBC Driver,the current JDBC driver can only be used to query data from def

How to make MSCK REPAIR TABLE execute automatically in AWS Athena

I have a Spark batch job which is executed hourly. Each run generates and stores new data in S3 with the directory naming pattern DATA/YEAR=?/MONTH=?/DATE=?/dat

Can I change a table from internal to external in hive?

I created a table in hive as a managed table, but it was supposed to be external, is it possible to change the table type of the table without losing the data?

Hive queries fail when the hive.execution.engine is set to MR, they work when set to Tez?

I am using HDP 2.1 sandbox for my work. The version of hive as listed by the jar file is: hive-exec-0.13.0.2.1.1.0-385.jar. I have created a directory in HDFS

SQL query to find count of males and females city wise

Let's say we have the following table: city gender abc m abc f def m Required output: city f_count m_count abc 1 1 def 0

How can I select rows where keeping only those that meet this criteria? sql/hive

I have a table like the following: +-------+------+ |ID |lang | +-------+------+ |1 |eng | |1 |pol | |2 |eng | |3 |gro | |

Convert string into binary in Hive

I want to match user ids from two tables in Hive. Unfortunately they are stored in different formats. In one table they are binary whereas in the second table t

How to load csv file in hive table?

I create table in hive and load csv file also from hdfs but when try to perform select query on created table I am getting results in encrypted format, can you

Use named_struct function in Hive with all the columns of a table

In Hive, you can use a function named_struct in order to create a list of key value pairs; the keys are usually the column names and the values are the values i