@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.mjs
CHANGED
|
@@ -59393,11 +59393,11 @@ var CstToAstConverter = class {
|
|
|
59393
59393
|
const queryVector = this.fromMmrQueryVectorParam(ctx.mmrQueryVectorParams());
|
|
59394
59394
|
if (queryVector) args.push(queryVector);
|
|
59395
59395
|
const onOption = this.fromMmrOnOption(ctx);
|
|
59396
|
-
args.push(onOption);
|
|
59397
|
-
const diversifyField = onOption
|
|
59396
|
+
if (onOption) args.push(onOption);
|
|
59397
|
+
const diversifyField = onOption?.args[0] ? onOption.args[0].args[0] : void 0;
|
|
59398
59398
|
const limitOption = this.fromMmrLimitOption(ctx);
|
|
59399
|
-
args.push(limitOption);
|
|
59400
|
-
const limit = limitOption.args[0];
|
|
59399
|
+
if (limitOption) args.push(limitOption);
|
|
59400
|
+
const limit = limitOption ? limitOption.args[0] : void 0;
|
|
59401
59401
|
const withOption = this.fromMmrWithOption(ctx.commandNamedParameters());
|
|
59402
59402
|
if (withOption) args.push(withOption);
|
|
59403
59403
|
const namedParameters = withOption ? withOption.args[0] : void 0;
|
|
@@ -59408,7 +59408,9 @@ var CstToAstConverter = class {
|
|
|
59408
59408
|
limit,
|
|
59409
59409
|
namedParameters
|
|
59410
59410
|
});
|
|
59411
|
-
command2.incomplete ||=
|
|
59411
|
+
command2.incomplete ||= queryVector?.incomplete ?? false;
|
|
59412
|
+
command2.incomplete ||= diversifyField?.incomplete ?? false;
|
|
59413
|
+
command2.incomplete ||= limitOption?.incomplete ?? false;
|
|
59412
59414
|
command2.incomplete ||= withOption?.incomplete ?? false;
|
|
59413
59415
|
return command2;
|
|
59414
59416
|
}
|
|
@@ -59427,6 +59429,7 @@ var CstToAstConverter = class {
|
|
|
59427
59429
|
}
|
|
59428
59430
|
fromMmrOnOption(ctx) {
|
|
59429
59431
|
const onToken = ctx.ON();
|
|
59432
|
+
if (!onToken) return;
|
|
59430
59433
|
const diversifyFieldCtx = ctx.qualifiedName();
|
|
59431
59434
|
const diversifyField = this.toColumn(diversifyFieldCtx);
|
|
59432
59435
|
const onOption = this.toOption(onToken.getText().toLowerCase(), diversifyFieldCtx);
|
|
@@ -59437,7 +59440,14 @@ var CstToAstConverter = class {
|
|
|
59437
59440
|
}
|
|
59438
59441
|
fromMmrLimitOption(ctx) {
|
|
59439
59442
|
const limitToken = ctx.MMR_LIMIT();
|
|
59443
|
+
if (!limitToken) return;
|
|
59440
59444
|
const limitValueCtx = ctx.integerValue();
|
|
59445
|
+
if (!limitValueCtx) {
|
|
59446
|
+
const limitOption2 = this.toOption(limitToken.getText().toLowerCase(), ctx, [], true);
|
|
59447
|
+
limitOption2.location.min = limitToken.symbol.start;
|
|
59448
|
+
limitOption2.location.max = limitToken.symbol.stop;
|
|
59449
|
+
return limitOption2;
|
|
59450
|
+
}
|
|
59441
59451
|
const limitOption = this.toOption(limitToken.getText().toLowerCase(), limitValueCtx);
|
|
59442
59452
|
limitOption.args.push(this.fromConstantToArray(limitValueCtx));
|
|
59443
59453
|
limitOption.location.min = limitToken.symbol.start;
|
|
@@ -59445,6 +59455,7 @@ var CstToAstConverter = class {
|
|
|
59445
59455
|
return limitOption;
|
|
59446
59456
|
}
|
|
59447
59457
|
fromMmrWithOption(namedParametersCtx) {
|
|
59458
|
+
if (!namedParametersCtx) return;
|
|
59448
59459
|
const withOption = this.fromCommandNamedParameters(namedParametersCtx);
|
|
59449
59460
|
const mapArg = withOption.args[0];
|
|
59450
59461
|
if (mapArg) {
|