spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mich Talebzadeh <>
Subject Re: Unable to write data from Spark into a Hive Managed table
Date Fri, 09 Aug 2019 16:51:04 GMT
Check your permissioning.

Can you do insert select from external table into Hive managed table
created by spark?

// Need to create and populate target ORC table transactioncodes_ll in
database Hive
HiveContext.sql("use accounts")
// Drop and create table transactioncodes_ll
spark.sql("DROP TABLE IF EXISTS accounts.transactioncodes_ll")
var sqltext = ""
sqltext = """
CREATE TABLE accounts.transactioncodes_ll (
id                         Int
,transactiontype           String
,description               String
COMMENT 'from Hive external table'
TBLPROPERTIES ( "orc.compress"="ZLIB" )
// Put data in Hive table. Clean up is already done
sqltext = """
INSERT INTO TABLE accounts.transactioncodes_ll
        , TRIM(transactiontype)
        , TRIM(description)


Dr Mich Talebzadeh

LinkedIn *

*Disclaimer:* Use it at your own risk. Any and all responsibility for any
loss, damage or destruction of data or any other property which may arise
from relying on this email's technical content is explicitly disclaimed.
The author will in no case be liable for any monetary damages arising from
such loss, damage or destruction.

On Fri, 9 Aug 2019 at 12:04, Debabrata Ghosh <> wrote:

> Hi ,
>               I am using Hortonworks Data Platform 3.1. I am unable to
> write data from Spark into a Hive Managed table but am able to do so in a
> Hive External table.
>               Would you please help get me with a resolution.
> Thanks,
> Debu

View raw message