hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mich Talebzadeh <mich.talebza...@gmail.com>
Subject Re: Specifying orc.stripe.size in Spark
Date Sun, 18 Dec 2016 10:19:09 GMT
You can use straight sql command to create ORC table in Hive. Assuming you
have registered a temp table

val HiveContext = new org.apache.spark.sql.hive.HiveContext(sc)
s.registerTempTable("tmp")
sqltext = """
CREATE TABLE test.dummy2
 (
     ID INT
   , CLUSTERED INT
   , SCATTERED INT
   , RANDOMISED INT
   , RANDOM_STRING VARCHAR(50)
   , SMALL_VC VARCHAR(10)
   , PADDING  VARCHAR(10)
)
--CLUSTERED BY (ID) INTO 256 BUCKETS
STORED AS ORC
TBLPROPERTIES ( "orc.compress"="SNAPPY",
"orc.create.index"="true",
"orc.bloom.filter.columns"="ID",
"orc.bloom.filter.fpp"="0.05",
"orc.stripe.size"="268435456",
"orc.row.index.stride"="10000" )
"""
HiveContext.sql(sqltext)

sqltext = """
INSERT INTO TABLE test.dummy2
SELECT
        *
FROM tmp
"""
HiveContext.sql(sqltext)

HTH

Dr Mich Talebzadeh



LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*



http://talebzadehmich.wordpress.com


*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 18 December 2016 at 09:02, Daniel Haviv <daniel.haviv@veracity-group.com>
wrote:

> Hi,
> When writing a dataframe using:
> df.write.orc("/path/to/orc")
>
> How can I specify orc parameters like orc.stripe.size ?
>
> Thank you,
> Daniel
>

Mime
View raw message