Method: GoodData::Command::Datasets#describe

Defined in:
lib/gooddata/commands/datasets.rb

#describeObject

Describe a data set. Currently, only a CSV data set is supported.

The command prescans the data set, picks possible LDM types for it's fields and asks user for confirmation.

Usage

gooddata datasets:describe --file-csv <path> --name <name> --output <output path>
  • --file-csv - path to the CSV file (required)
  • --name - name of the data set (user will be prompted unless provided)
  • --output - name of the output JSON file with the model description (user will be prompted unless provided)


48
49
50
51
52
53
54
55
56
# File 'lib/gooddata/commands/datasets.rb', line 48

def describe
  columns = ask_for_fields
  name = extract_option('--name') || ask('Enter the dataset name')
  output = extract_option('--output') || ask('Enter path to the file where to save the model description', :default => "#{name}.json")
  open output, 'w' do |f|
    f << JSON.pretty_generate(:title => name, :columns => columns) + "\n"
    f.flush
  end
end