Я думаю, что я что-то отсутствует основной здесь, не могу понять, что это такое ..Google Cloud ошибка DATALAB запрашивая таблицы BigQuery
дата BigQuery распределяли Запросы таблицы из Google облака DATALAB. Большинство других запросов извлекают данные, как ожидалось, но не уверены, почему в этой конкретной таблице выбор не будет работать, однако работает запрос count (1).
%%sql
select * from Mydataset.sample_sales_yearly_part limit 10
Я получаю ниже ошибки:
KeyErrorTraceback (most recent call last) /usr/local/lib/python2.7/dist-packages/IPython/core/formatters.pyc in
__call__(self, obj)
305 pass
306 else:
--> 307 return printer(obj)
308 # Finally look for special method names
309 method = get_real_method(obj, self.print_method)
/usr/local/lib/python2.7/dist-packages/datalab/bigquery/commands/_bigquery.pyc in _repr_html_query_results_table(results)
999 1000 def _repr_html_query_results_table(results):
-> 1001 return _table_viewer(results) 1002 1003
/usr/local/lib/python2.7/dist-packages/datalab/bigquery/commands/_bigquery.pyc in _table_viewer(table, rows_per_page, fields)
969 meta_time = ''
970
--> 971 data, total_count = datalab.utils.commands.get_data(table, fields, first_row=0, count=rows_per_page)
972
973 if total_count < 0:
/usr/local/lib/python2.7/dist-packages/datalab/utils/commands/_utils.pyc in get_data(source, fields, env, first_row, count, schema)
226 return _get_data_from_table(source.results(), fields, first_row, count, schema)
227 elif isinstance(source, datalab.bigquery.Table):
--> 228 return _get_data_from_table(source, fields, first_row, count, schema)
229 else:
230 raise Exception("Cannot chart %s; unsupported object type" % source)
/usr/local/lib/python2.7/dist-packages/datalab/utils/commands/_utils.pyc in _get_data_from_table(source, fields, first_row, count, schema)
174 gen = source.range(first_row, count) if count >= 0 else source
175 rows = [{'c': [{'v': row[c]} if c in row else {} for c in fields]} for row in gen]
--> 176 return {'cols': _get_cols(fields, schema), 'rows': rows}, source.length
177
178
/usr/local/lib/python2.7/dist-packages/datalab/utils/commands/_utils.pyc in _get_cols(fields, schema)
108 if schema:
109 f = schema[col]
--> 110 cols.append({'id': f.name, 'label': f.name, 'type': typemap[f.data_type]})
111 else:
112 # This will only happen if we had no rows to infer a schema from, so the type
KeyError: u'DATE'
QueryResultsTable job_Ckq91E5HuI8GAMPteXKeHYWMwMo
Спасибо Омару, я смог преодолеть это, набрав строку поля даты. Я буду искать новую версию облачного datalab. –
Как изменить настройки для использования стандартного sql по умолчанию в облачном datalab? –
Новый выпуск сейчас отсутствует. Что касается выбора стандартного SQL, теперь есть флаг «-d standard», который вы можете добавить к магии ячейки %% sql ... посмотрите на блок «BigQuery Standard SQL.ipynb» в приведенных в комплекте руководствах для примеров. –