1

I am trying to create a database in druid superset and I have successfully created the database in druid superset, but this database is not showing in SQL lab.

I think this problem is due to a missing schema. How should I add schema in druid superset and what is the proper format to add schema?

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • 3
    Welcome to StackOverflow! Can you share what you've tried so far? StackOverflow isn't a free code-writing service, and expects you to try to solve your own problem first. Please update your question to show what you have already tried, showing the specific problem you are facing in a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve). For further information, please see [how to ask good questions](http://stackoverflow.com/help/how-to-ask), and take the [tour of the site](http://stackoverflow.com/tour). – coagmano Apr 13 '18 at 09:02

2 Answers2

0

You have to create schema in Schema Registry by clicking + button, for this input data:

 {
"lng": -79.33333333333333,
"observation": "K2G4 071225Z AUTO 00000KT 10SM SCT035 BKN041 BKN047 10/08 A3010 RMK AO1",
"ICAO": "K2G4",
"clouds": "scattered clouds",
"dewPoint": "8",
"cloudsCode": "SCT",
"datetime": "2018-05-07 12:25:00",
"temperature": "10",
"humidity": 87,
"stationName": "GARRETT CO",
"weatherCondition": "n/a",
"windDirection": 0,
"windSpeed": "00",
"lat": 39.583333333333336}

Schema would look like:

    {
     "type": "record",
     "namespace": "com.orendainx.hortonworks.weather",
     "name": "weather2",
     "fields": [
      {
       "name": "lng",
       "type": "double"
      },
      {
       "name": "observation",
       "type": "string"
      },
      {
       "name": "ICAO",
       "type": "string"
      },
      {
       "name": "clouds",
       "type": "string"
      },
      {
       "name": "dewPoint",
       "type": "string"
      },
      {
       "name": "datetime",
       "type": "long"
      },
      {
       "name": "temperature",
       "type": "string"
      },
      {
       "name": "humidity",
       "type": "int"
      },
      {
       "name": "stationName",
       "type": "string"
      },
      {
       "name": "weatherCondition",
       "type": "string"
      },
      {
       "name": "windDirection",
       "type": "int"
      },
      {
       "name": "windSpeed",
       "type": "string"
      },
      {
       "name": "lat",
       "type": "double"
      }
     ]
    }
TylerH
  • 20,799
  • 66
  • 75
  • 101
Robert Lepen
  • 79
  • 11
0

Druid datasources by default do not show up in SQL Lab because druid is not a SQL database. However, Apache Calcite has created a translation from SQL to DQL (Druid query language). Therefore one can add druid as a SQL database if SQL is enabled on the broker. See this answer to a somewhat similar question.

Climbs_lika_Spyder
  • 6,004
  • 3
  • 39
  • 53