File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -396,11 +396,17 @@ public function describeTable($table)
396
396
397
397
/**
398
398
* @param string $yql
399
- * @param ScanQueryMode $mode
399
+ * @param array $parameters
400
+ * @param int $mode
400
401
* @return \Generator
402
+ * @throws Exception
401
403
*/
402
- public function scanQuery ($ yql , $ mode = ScanQueryMode::MODE_EXEC )
404
+ public function scanQuery ($ yql , $ parameters = [], $ mode = ScanQueryMode::MODE_EXEC )
403
405
{
406
+ if ($ parameters != []){
407
+ throw new Exception ("Not implemented " );
408
+ }
409
+
404
410
$ q = new Query (['yql_text ' => $ yql ]);
405
411
406
412
return $ this ->streamRequest ('StreamExecuteScanQuery ' , [
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ class ScanQueryTest extends TestCase
13
13
14
14
function testScanQuery ()
15
15
{
16
- self ::expectNotToPerformAssertions ();
17
16
18
17
$ config = [
19
18
@@ -49,13 +48,17 @@ function testScanQuery()
49
48
FROM scan_table
50
49
WHERE id = 1; ' ;
51
50
52
- $ scanWithOutParam = $ table ->scanQuery ($ yql );
53
- $ scanWithExplainParam = $ table ->scanQuery ($ yql , ScanQueryMode::MODE_EXPLAIN );
54
- $ scanWithExecParam = $ table ->scanQuery ($ yql , ScanQueryMode::MODE_EXEC );
51
+ $ scanWithOutMode = $ table ->scanQuery ($ yql );
52
+ $ scanWithExplainMode = $ table ->scanQuery ($ yql, [] , ScanQueryMode::MODE_EXPLAIN );
53
+ $ scanWithExecMode = $ table ->scanQuery ($ yql, [] , ScanQueryMode::MODE_EXEC );
55
54
56
55
// These `foreach` needs for requests
57
- foreach ($ scanWithOutParam as $ value ){}
58
- foreach ($ scanWithExplainParam as $ value ){}
59
- foreach ($ scanWithExecParam as $ value ){}
56
+ foreach ($ scanWithOutMode as $ value ){}
57
+ foreach ($ scanWithExplainMode as $ value ){}
58
+ foreach ($ scanWithExecMode as $ value ){}
59
+
60
+ self ::expectExceptionMessage ("Not implemented " );
61
+ $ scanWithParams = $ table ->scanQuery ($ yql , ["value " =>"some " ]);
62
+ foreach ($ scanWithParams as $ value ){}
60
63
}
61
64
}
You can’t perform that action at this time.
0 commit comments