未验证 提交 3f284eaa 编写于 作者: V Ville Brofeldt 提交者: Ville Brofeldt

fix: make __time an ok column name in SQL Lab (#10336)

上级 08d43b15
......@@ -321,6 +321,11 @@ export const queryWithBadColumns = {
name: '_TIMESTAMP',
type: 'TIMESTAMP',
},
{
is_date: true,
name: '__TIME',
type: 'TIMESTAMP',
},
{
is_date: true,
name: '__TIMESTAMP',
......
......@@ -104,7 +104,7 @@ class ExploreResultsButton extends React.PureComponent {
getInvalidColumns() {
const re1 = /^[A-Za-z_]\w*$/; // starts with char or _, then only alphanum
const re2 = /__\d+$/; // does not finish with __ and then a number which screams dup col name
const re3 = /^__/; // is not a reserved column name e.g. __timestamp
const re3 = /^__timestamp/i; // is not a reserved temporal column alias
return this.props.query.results.selected_columns
.map(col => col.name)
......@@ -199,9 +199,10 @@ class ExploreResultsButton extends React.PureComponent {
<strong>AS my_alias</strong>
</code>
){' '}
{t(`limited to alphanumeric characters and underscores. Column aliases starting
with double underscores or ending with double underscores followed by a
numeric value are not allowed for reasons discussed in Github issue #5739.
{t(`limited to alphanumeric characters and underscores. The alias "__timestamp"
used as for the temporal expression and column aliases ending with
double underscores followed by a numeric value are not allowed for reasons
discussed in Github issue #5739.
`)}
</div>
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册