Commit 192e170 1 parent b835409 commit 192e170 Copy full SHA for 192e170
File tree 5 files changed +45
-0
lines changed
presto-hive/src/test/java/com/facebook/presto/hive
presto-main/src/main/java/com/facebook/presto
main/java/com/facebook/presto/spi
test/java/com/facebook/presto/spi
5 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -1235,6 +1235,12 @@ public RuntimeStats getRuntimeStats()
1235
1235
{
1236
1236
return session .getRuntimeStats ();
1237
1237
}
1238
+
1239
+ @ Override
1240
+ public ConnectorSession forConnectorId (ConnectorId connectorId )
1241
+ {
1242
+ return this ;
1243
+ }
1238
1244
};
1239
1245
}
1240
1246
Original file line number Diff line number Diff line change @@ -199,4 +199,10 @@ public RuntimeStats getRuntimeStats()
199
199
{
200
200
return session .getRuntimeStats ();
201
201
}
202
+
203
+ @ Override
204
+ public ConnectorSession forConnectorId (ConnectorId connectorId )
205
+ {
206
+ return new FullConnectorSession (session , identity );
207
+ }
202
208
}
Original file line number Diff line number Diff line change 17
17
import com .facebook .presto .common .function .SqlFunctionProperties ;
18
18
import com .facebook .presto .common .type .TimeZoneKey ;
19
19
import com .facebook .presto .execution .QueryIdGenerator ;
20
+ import com .facebook .presto .spi .ConnectorId ;
20
21
import com .facebook .presto .spi .ConnectorSession ;
21
22
import com .facebook .presto .spi .PrestoException ;
22
23
import com .facebook .presto .spi .WarningCollector ;
@@ -224,6 +225,26 @@ public RuntimeStats getRuntimeStats()
224
225
return new RuntimeStats ();
225
226
}
226
227
228
+ @ Override
229
+ public ConnectorSession forConnectorId (ConnectorId connectorId )
230
+ {
231
+ return new TestingConnectorSession (
232
+ sqlFunctionProperties .getSessionUser (),
233
+ identity ,
234
+ source ,
235
+ traceToken ,
236
+ timeZoneKey ,
237
+ locale ,
238
+ startTime ,
239
+ ImmutableList .copyOf (properties .values ()),
240
+ propertyValues ,
241
+ sqlFunctionProperties .isLegacyRowFieldOrdinalAccessEnabled (),
242
+ clientInfo ,
243
+ clientTags ,
244
+ schema ,
245
+ sessionFunctions );
246
+ }
247
+
227
248
@ Override
228
249
public String toString ()
229
250
{
Original file line number Diff line number Diff line change @@ -66,4 +66,10 @@ default boolean isReadConstraints()
66
66
WarningCollector getWarningCollector ();
67
67
68
68
RuntimeStats getRuntimeStats ();
69
+
70
+ /**
71
+ * returns a ConnectorSession for a specific ConnectorId
72
+ * @return
73
+ */
74
+ ConnectorSession forConnectorId (ConnectorId connectorId );
69
75
}
Original file line number Diff line number Diff line change @@ -130,6 +130,12 @@ public RuntimeStats getRuntimeStats()
130
130
{
131
131
return new RuntimeStats ();
132
132
}
133
+
134
+ @ Override
135
+ public ConnectorSession forConnectorId (ConnectorId connectorId )
136
+ {
137
+ return this ;
138
+ }
133
139
};
134
140
135
141
private TestingSession () {}
You can’t perform that action at this time.
0 commit comments