@elastic/esql 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +16 -5
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +16 -5
- package/lib/index.mjs.map +1 -1
- package/lib/parser/core/cst_to_ast_converter.d.ts.map +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -59506,11 +59506,11 @@ var CstToAstConverter = class {
|
|
|
59506
59506
|
const queryVector = this.fromMmrQueryVectorParam(ctx.mmrQueryVectorParams());
|
|
59507
59507
|
if (queryVector) args.push(queryVector);
|
|
59508
59508
|
const onOption = this.fromMmrOnOption(ctx);
|
|
59509
|
-
args.push(onOption);
|
|
59510
|
-
const diversifyField = onOption
|
|
59509
|
+
if (onOption) args.push(onOption);
|
|
59510
|
+
const diversifyField = onOption?.args[0] ? onOption.args[0].args[0] : void 0;
|
|
59511
59511
|
const limitOption = this.fromMmrLimitOption(ctx);
|
|
59512
|
-
args.push(limitOption);
|
|
59513
|
-
const limit = limitOption.args[0];
|
|
59512
|
+
if (limitOption) args.push(limitOption);
|
|
59513
|
+
const limit = limitOption ? limitOption.args[0] : void 0;
|
|
59514
59514
|
const withOption = this.fromMmrWithOption(ctx.commandNamedParameters());
|
|
59515
59515
|
if (withOption) args.push(withOption);
|
|
59516
59516
|
const namedParameters = withOption ? withOption.args[0] : void 0;
|
|
@@ -59521,7 +59521,9 @@ var CstToAstConverter = class {
|
|
|
59521
59521
|
limit,
|
|
59522
59522
|
namedParameters
|
|
59523
59523
|
});
|
|
59524
|
-
command2.incomplete ||=
|
|
59524
|
+
command2.incomplete ||= queryVector?.incomplete ?? false;
|
|
59525
|
+
command2.incomplete ||= diversifyField?.incomplete ?? false;
|
|
59526
|
+
command2.incomplete ||= limitOption?.incomplete ?? false;
|
|
59525
59527
|
command2.incomplete ||= withOption?.incomplete ?? false;
|
|
59526
59528
|
return command2;
|
|
59527
59529
|
}
|
|
@@ -59540,6 +59542,7 @@ var CstToAstConverter = class {
|
|
|
59540
59542
|
}
|
|
59541
59543
|
fromMmrOnOption(ctx) {
|
|
59542
59544
|
const onToken = ctx.ON();
|
|
59545
|
+
if (!onToken) return;
|
|
59543
59546
|
const diversifyFieldCtx = ctx.qualifiedName();
|
|
59544
59547
|
const diversifyField = this.toColumn(diversifyFieldCtx);
|
|
59545
59548
|
const onOption = this.toOption(onToken.getText().toLowerCase(), diversifyFieldCtx);
|
|
@@ -59550,7 +59553,14 @@ var CstToAstConverter = class {
|
|
|
59550
59553
|
}
|
|
59551
59554
|
fromMmrLimitOption(ctx) {
|
|
59552
59555
|
const limitToken = ctx.MMR_LIMIT();
|
|
59556
|
+
if (!limitToken) return;
|
|
59553
59557
|
const limitValueCtx = ctx.integerValue();
|
|
59558
|
+
if (!limitValueCtx) {
|
|
59559
|
+
const limitOption2 = this.toOption(limitToken.getText().toLowerCase(), ctx, [], true);
|
|
59560
|
+
limitOption2.location.min = limitToken.symbol.start;
|
|
59561
|
+
limitOption2.location.max = limitToken.symbol.stop;
|
|
59562
|
+
return limitOption2;
|
|
59563
|
+
}
|
|
59554
59564
|
const limitOption = this.toOption(limitToken.getText().toLowerCase(), limitValueCtx);
|
|
59555
59565
|
limitOption.args.push(this.fromConstantToArray(limitValueCtx));
|
|
59556
59566
|
limitOption.location.min = limitToken.symbol.start;
|
|
@@ -59558,6 +59568,7 @@ var CstToAstConverter = class {
|
|
|
59558
59568
|
return limitOption;
|
|
59559
59569
|
}
|
|
59560
59570
|
fromMmrWithOption(namedParametersCtx) {
|
|
59571
|
+
if (!namedParametersCtx) return;
|
|
59561
59572
|
const withOption = this.fromCommandNamedParameters(namedParametersCtx);
|
|
59562
59573
|
const mapArg = withOption.args[0];
|
|
59563
59574
|
if (mapArg) {
|