This is an automated email from the ASF dual-hosted git repository.
vogievetsky pushed a commit to branch 29.0.1
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/29.0.1 by this push:
new b1aff9526fa make double detection better (#15998) (#16060)
b1aff9526fa is described below
commit b1aff9526fa65850491e18d9553eb8e3a9b08397
Author: Karan Kumar <[email protected]>
AuthorDate: Sat Mar 9 03:05:31 2024 +0530
make double detection better (#15998) (#16060)
Co-authored-by: Vadim Ogievetsky <[email protected]>
---
.../src/druid-models/ingestion-spec/ingestion-spec.spec.ts | 1 +
web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx | 4 +++-
.../views/workbench-view/input-format-step/input-format-step.tsx | 9 ++++++---
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/web-console/src/druid-models/ingestion-spec/ingestion-spec.spec.ts
b/web-console/src/druid-models/ingestion-spec/ingestion-spec.spec.ts
index 86787010f27..d6513aa2081 100644
--- a/web-console/src/druid-models/ingestion-spec/ingestion-spec.spec.ts
+++ b/web-console/src/druid-models/ingestion-spec/ingestion-spec.spec.ts
@@ -720,6 +720,7 @@ describe('spec utils', () => {
expect(guessColumnTypeFromInput([null, 1, 2.1, 3],
true)).toEqual('double');
expect(guessColumnTypeFromInput([null, '1', '2.1', '3'],
false)).toEqual('string');
expect(guessColumnTypeFromInput([null, '1', '2.1', '3'],
true)).toEqual('double');
+ expect(guessColumnTypeFromInput([null, '1.0', '2.0', '3.0'],
true)).toEqual('double');
});
it('works for ARRAY<string>', () => {
diff --git a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
index e3bd4fb9e45..bd9a8989225 100644
--- a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
+++ b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
@@ -2526,7 +2526,9 @@ function isIntegerOrNull(x: any): boolean {
function isIntegerOrNullAcceptString(x: any): boolean {
return (
- x == null || ((typeof x === 'number' || typeof x === 'string') &&
Number.isInteger(Number(x)))
+ x == null ||
+ (typeof x === 'number' && Number.isInteger(x)) ||
+ (typeof x === 'string' && !x.includes('.') && Number.isInteger(Number(x)))
);
}
diff --git
a/web-console/src/views/workbench-view/input-format-step/input-format-step.tsx
b/web-console/src/views/workbench-view/input-format-step/input-format-step.tsx
index 9729b224831..cfe51d8fc3d 100644
---
a/web-console/src/views/workbench-view/input-format-step/input-format-step.tsx
+++
b/web-console/src/views/workbench-view/input-format-step/input-format-step.tsx
@@ -193,6 +193,9 @@ export const InputFormatStep = React.memo(function
InputFormatStep(props: InputF
inputSourceAndFormat.inputSource,
);
+ const needsResample = inputSourceAndFormatToSample !== inputSourceAndFormat;
+ const nextDisabled = !inputSourceFormatAndMore || needsResample;
+
return (
<div className="input-format-step">
<div className="preview">
@@ -246,7 +249,7 @@ export const InputFormatStep = React.memo(function
InputFormatStep(props: InputF
onChange={setInputSourceAndFormat as any}
/>
)}
- {inputSourceAndFormatToSample !== inputSourceAndFormat && (
+ {needsResample && (
<FormGroup className="control-buttons">
<Button
text="Preview changes"
@@ -283,7 +286,7 @@ export const InputFormatStep = React.memo(function
InputFormatStep(props: InputF
text={altText}
rightIcon={IconNames.ARROW_TOP_RIGHT}
minimal
- disabled={!inputSourceFormatAndMore}
+ disabled={nextDisabled}
onClick={() => {
if (!inputSourceFormatAndMore) return;
onAltSet(inputSourceFormatAndMore);
@@ -299,7 +302,7 @@ export const InputFormatStep = React.memo(function
InputFormatStep(props: InputF
text={doneButton ? 'Done' : 'Next'}
rightIcon={doneButton ? IconNames.TICK : IconNames.ARROW_RIGHT}
intent={Intent.PRIMARY}
- disabled={!inputSourceFormatAndMore}
+ disabled={nextDisabled}
onClick={() => {
if (!inputSourceFormatAndMore) return;
onSet(inputSourceFormatAndMore);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]