Skip to content

Commit c444d96

Browse files
UnresolvedRelation.isStreaming + STREAM SQL clause
1 parent 7629578 commit c444d96

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

docs/logical-operators/UnresolvedRelation.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ title: UnresolvedRelation
1414

1515
* <span id="multipartIdentifier"> Multi-part identifier
1616
* <span id="options"> Options
17-
* <span id="isStreaming"> [isStreaming](LogicalPlan.md#isStreaming) flag (default:`false`)
17+
* [isStreaming](#isStreaming) flag
1818

1919
`UnresolvedRelation` is created (possibly indirectly using [apply](#apply) factory) when:
2020

@@ -27,6 +27,19 @@ title: UnresolvedRelation
2727
* `DataStreamReader.table` ([Spark Structured Streaming]({{ book.structured_streaming }}/DataStreamReader#table)) operator is used
2828
* [table](../catalyst-dsl/index.md#table) ([Catalyst DSL](../catalyst-dsl/index.md)) operator is used
2929

30+
### isStreaming Flag { #isStreaming }
31+
32+
`UnresolvedRelation` is given [isStreaming](LogicalPlan.md#isStreaming) flag when [created](#creating-instance).
33+
34+
`isStreaming` can be specified with [apply](#apply) factory method.
35+
36+
`isStreaming` is disabled (`false`) by default.
37+
38+
`isStreaming` is enabled (`true`) when:
39+
40+
* `AstBuilder` is requested to [parse STREAM relation clause](../sql/AstBuilder.md#visitStreamTableName)
41+
* `DataStreamReader.table` ([Spark Structured Streaming]({{ book.structured_streaming }}/DataStreamReader/#table)) operator is used
42+
3043
## Creating UnresolvedRelation { #apply }
3144

3245
```scala
@@ -49,7 +62,7 @@ apply(
4962

5063
## Name { #name }
5164

52-
??? note "Signature"
65+
??? note "NamedRelation"
5366

5467
```scala
5568
name: String
@@ -69,7 +82,7 @@ tableName: String
6982

7083
## resolved
7184

72-
??? note "Signature"
85+
??? note "LogicalPlan"
7386

7487
```scala
7588
resolved: Boolean
@@ -81,7 +94,7 @@ tableName: String
8194

8295
## nodePatterns { #nodePatterns }
8396

84-
??? note "Signature"
97+
??? note "TreeNode"
8598

8699
```scala
87100
nodePatterns: Seq[TreePattern]

docs/sql/AstBuilder.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,8 @@ Creates an [UnresolvedRelation](../logical-operators/UnresolvedRelation.md) logi
698698

699699
```antlr
700700
streamRelationPrimary
701-
: STREAM multipartIdentifier [WITH options]? (AS? strictIdentifier identifierList?)? #streamTableName
702-
| STREAM '(' multipartIdentifier ')' [WITH options]? (AS? strictIdentifier identifierList?)? #streamTableName
701+
: STREAM multipartIdentifier [WITH options]? [WATERMARK colName DELAY OF delay] (AS? strictIdentifier identifierList?)? #streamTableName
702+
| STREAM '(' multipartIdentifier ')' [WITH options]? [WATERMARK colName DELAY OF delay] (AS? strictIdentifier identifierList?)? #streamTableName
703703
;
704704
```
705705

@@ -1149,6 +1149,25 @@ With no `namedArgumentExpression` used, `extractNamedArgument` creates an [Expre
11491149

11501150
* `AstBuilder` is requested to [visitFunctionCall](#visitFunctionCall) and [visitTableValuedFunction](#visitTableValuedFunction)
11511151

1152+
## createUnresolvedRelation { #createUnresolvedRelation }
1153+
1154+
```scala
1155+
createUnresolvedRelation(
1156+
ctx: IdentifierReferenceContext,
1157+
optionsClause: Option[OptionsClauseContext] = None,
1158+
writePrivileges: Seq[TableWritePrivilege] = Nil): LogicalPlan // (1)!
1159+
createUnresolvedRelation(
1160+
ctx: ParserRuleContext,
1161+
ident: Seq[String],
1162+
optionsClause: Option[OptionsClauseContext],
1163+
writePrivileges: Seq[TableWritePrivilege],
1164+
isStreaming: Boolean): UnresolvedRelation
1165+
```
1166+
1167+
1. Creates an [UnresolvedRelation](../logical-operators/UnresolvedRelation.md) logical operator with [isStreaming](../logical-operators/UnresolvedRelation.md#isStreaming) flag disabled (`false`)
1168+
1169+
`createUnresolvedRelation` creates an [UnresolvedRelation](../logical-operators/UnresolvedRelation.md) logical operator.
1170+
11521171
## Create UnresolvedTable Logical Operator { #createUnresolvedTable }
11531172

11541173
```scala

0 commit comments

Comments
 (0)