2

I have created a delta table in azure databricks with COMMENT as below.

DROP TABLE IF EXISTS dbtest.test_antony;
CREATE TABLE IF NOT EXISTS dbtest.test_antony(
  db_name STRING COMMENT 'EN: Database Name ',
  table_name STRING COMMENT 'EN: Table Name '
)
USING delta
LOCATION 'dbfs:/mnt/user/antony/test_antony'
COMMENT 'my test table'

I tried to take extract of this table by using below comments, but no where I could see the table comment 'my test table'.

describe dbtest.test_antony;
describe detail dbtest.test_antony;
describe table formatted dbtest.test_antony;
describe table extended dbtest.test_antony;

enter image description here

Also when I run SHOW CREATE TABLE I am not able to see COMMENT for the table. I tried with cluster versions 10.4 and 11.2

How Could I get the table comment in table extract ? Any leads appreciated!

Antony
  • 970
  • 3
  • 20
  • 46

1 Answers1

0

Hmmm, maybe it's dependent on the Databricks Runtime version and/or on the Hive metastore version (if you're not using built-in metastore).

Your code works perfectly for me on DBR 11.1, and describe table extended returns Comment row as well

enter image description here

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • We are using built in metastore and we are using cluster version 10.4. But I tried with cluster version 11.2 and still COMMENT is not available for tables. – Antony Sep 20 '22 at 05:58
  • Is there any other chance for omitting the table comment? – Antony Sep 20 '22 at 07:27
  • I'm not aware about such thing... – Alex Ott Sep 20 '22 at 09:27
  • Alex, Could you please let me know the table properties returned when you run describe table command? – Antony Sep 27 '22 at 05:11
  • `[delta.minReaderVersion=1,delta.minWriterVersion=2]` Are you using external Hive metastore? If yes, maybe metastore version doesn't support comments on tables? – Alex Ott Sep 27 '22 at 07:08