sai m
sai m

Reputation: 129

How can I create an EXTERNAL table with HIVE format in databricks

I am having a external table with below format in hive.

CREATE EXTERNAL TABLE cs_mbr_prov(
  key struct<inid:string,......>, 
  memkey string, 
  ob_id string, 
  .....
)
  
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.hbase.HBaseSerDe' 
STORED BY 
  'org.apache.hadoop.hive.hbase.HBaseStorageHandler' 
WITH SERDEPROPERTIES ( 
  'hbase.columns.mapping'=' :key,ci:MEMKEY, .....', 
  'serialization.format'='1')

I want to create same type of table in Azure Databricks where my Input and Output are in parquet format.

Upvotes: 0

Views: 612

Answers (1)

Vamsi Bitra
Vamsi Bitra

Reputation: 2764

As per the official Doc I created and reproduced the table with Input and Output are in parquet format.

Sample code:

CREATE EXTERNAL TABLE `vams`(
  `country` string,
  `count` int)
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
  
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  'dbfs:/FileStore/'
TBLPROPERTIES (
  'totalSize'='2335',
  'numRows'='240',
  'rawDataSize'='2095',
  'COLUMN_STATS_ACCURATE'='true',
  'numFiles'='1',
  'transient_lastDdlTime'='1418173653')

Ref1

Ref3

Reference:

https://learn.microsoft.com/en-us/azure/databricks/spark/latest/spark-sql/language-manual/sql-ref-syntax-ddl-create-table-hiveformat

Upvotes: 1

Related Questions