public class JsonView extends JsonTable
Like base class JsonTable,
occurs within JsonMapSchema.tables.
A view is modifiable if contains only SELECT, FROM, WHERE (no JOIN, aggregation or sub-queries) and every column:
The second clause allows Calcite to automatically provide the correct
value for hidden columns. It is useful in, say, a multi-tenant environment,
where the tenantId column is hidden, mandatory (NOT NULL), and has a
constant value for a particular view.
Errors regarding modifiable views:
Description of schema elements| Modifier and Type | Field and Description |
|---|---|
@Nullable Boolean |
modifiable
Whether this view should allow INSERT requests.
|
@Nullable List<String> |
path
Schema name(s) to use when resolving query.
|
Object |
sql
SQL query that is the definition of the view.
|
| Constructor and Description |
|---|
JsonView(String name,
JsonStream stream,
Object sql,
@Nullable List<String> path,
@Nullable Boolean modifiable) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ModelHandler handler) |
String |
getSql()
Returns the SQL query as a string, concatenating a list of lines if
necessary.
|
String |
toString() |
public final Object sql
Must be a string or a list of strings (which are concatenated into a multi-line SQL string, separated by newlines).
public final @Nullable List<String> path
If not specified, defaults to current schema.
public final @Nullable Boolean modifiable
The values have the following meanings:
The default value is null.
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.