You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/10/11 03:16:15 UTC

[GitHub] [inlong] bluewang opened a new pull request, #6135: [INLONG-5814][Dashboard] Supports setting the precision of a field when adding a table field

bluewang opened a new pull request, #6135:
URL: https://github.com/apache/inlong/pull/6135

   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   - Title Example: [INLONG-XYZ][Component] Title of the pull request
   
   *(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
   
   - Fixes https://github.com/apache/inlong/issues/5814


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] leezng merged pull request #6135: [INLONG-5814][Dashboard] Supports setting the precision of a field when adding a table field

Posted by GitBox <gi...@apache.org>.
leezng merged PR #6135:
URL: https://github.com/apache/inlong/pull/6135


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] leezng commented on a diff in pull request #6135: [INLONG-5814][Dashboard] Supports setting the precision of a field when adding a table field

Posted by GitBox <gi...@apache.org>.
leezng commented on code in PR #6135:
URL: https://github.com/apache/inlong/pull/6135#discussion_r991861091


##########
inlong-dashboard/src/metas/sinks/sqlServer.tsx:
##########
@@ -20,36 +20,41 @@ import type { FieldItemType } from '@/metas/common';
 import EditableTable from '@/components/EditableTable';
 import { sourceFields } from './common/sourceFields';
 
-const sqlserverFieldTypes = [
-  'char',
-  'varchar',
-  'nchar',
-  'nvarchar',
-  'text',
-  'ntext',
-  'xml',
-  'BIGINT',
-  'BIGSERIAL',
-  'decimal',
-  'money',
-  'smallmoney',
-  'numeric',
-  'float',
-  'real',
-  'bit',
-  'int',
-  'tinyint',
-  'smallint',
-  'bigint',
-  'time',
-  'datetime',
-  'datetime2',
-  'smalldatetime',
-  'datetimeoffset',
-].map(item => ({
-  label: item,
-  value: item,
-}));
+const fieldTypesConf = {
+  CHAR: (m, d) => (1 <= m && m <= 8000 ? '' : '1-8000'),

Review Comment:
   It is recommended to use the prompt `1<m<10` instead of `1-10`, because there are 2 parameters (m/d) in part.



##########
inlong-dashboard/src/metas/sinks/sqlServer.tsx:
##########
@@ -20,36 +20,41 @@ import type { FieldItemType } from '@/metas/common';
 import EditableTable from '@/components/EditableTable';
 import { sourceFields } from './common/sourceFields';
 
-const sqlserverFieldTypes = [
-  'char',
-  'varchar',
-  'nchar',
-  'nvarchar',
-  'text',
-  'ntext',
-  'xml',
-  'BIGINT',
-  'BIGSERIAL',
-  'decimal',
-  'money',
-  'smallmoney',
-  'numeric',
-  'float',
-  'real',
-  'bit',
-  'int',
-  'tinyint',
-  'smallint',
-  'bigint',
-  'time',
-  'datetime',
-  'datetime2',
-  'smalldatetime',
-  'datetimeoffset',
-].map(item => ({
-  label: item,
-  value: item,
-}));
+const fieldTypesConf = {
+  CHAR: (m, d) => (1 <= m && m <= 8000 ? '' : '1-8000'),
+  VARCHAR: (m, d) => (1 <= m && m <= 8000 ? '' : '1-8000'),
+  NCHAR: (m, d) => (1 <= m && m <= 4000 ? '' : '1-4000'),
+  NVARCHAR: (m, d) => (1 <= m && m <= 4000 ? '' : '1-4000'),
+  TEXT: () => '',
+  NTEXT: () => '',
+  XML: () => '',
+  BIGINT: (m, d) => (1 <= m && m <= 20 ? '' : '1<=M<=20'),
+  BIGSERIAL: (m, d) => (1 <= m && m <= 20 ? '' : '1<=M<=20'),
+  DECIMAL: (m, d) => (1 <= m && m <= 38 && 0 <= d && d < m ? '' : '1<=M<=38,0<=D<M'),
+  MONEY: (m, d) => (1 <= m && m <= 15 && 1 <= d && d <= 4 ? '' : '1<=M<=15,1<=D<=4'),
+  SMALLMONEY: (m, d) => (1 <= m && m <= 7 && 1 <= d && d <= 4 ? '' : '1<=M<=7,1<=D<=4'),
+  NUMERIC: (m, d) => (1 <= m && m <= 38 && 1 <= d && d <= 4 ? '' : '1<=M<=38,-<=D<=4'),

Review Comment:
   `-<=D<=4`. It seems error



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #6135: [INLONG-5814][Dashboard] Supports setting the precision of a field when adding a table field

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #6135:
URL: https://github.com/apache/inlong/pull/6135#discussion_r992162473


##########
inlong-dashboard/src/metas/sinks/greenplum.tsx:
##########
@@ -20,35 +20,40 @@ import type { FieldItemType } from '@/metas/common';
 import EditableTable from '@/components/EditableTable';
 import { sourceFields } from './common/sourceFields';
 
-const greenplumFieldTypes = [
-  'SMALLINT',
-  'INT2',
-  'SMALLSERIAL',
-  'SERIAL',
-  'SERIAL2',
-  'INTEGER',
-  'BIGINT',
-  'BIGSERIAL',
-  'REAL',
-  'FLOAT4',
-  'FLOAT8',
-  'DOUBLE',
-  'NUMERIC',
-  'DECIMAL',
-  'BOOLEAN',
-  'DATE',
-  'TIME',
-  'TIMESTAMP',
-  'CHAR',
-  'CHARACTER',
-  'VARCHAR',
-  'TEXT',
-  'BYTEA',
-  // 'interval',
-].map(item => ({
-  label: item,
-  value: item,
-}));
+const fieldTypesConf = {
+  SMALLINT: (m, d) => (1 <= m && m <= 6 ? '' : '1<=M<=6'),
+  INT2: () => '',
+  SMALLSERIAL: (m, d) => (1 <= m && m <= 6 ? '' : '1<=M<=6'),
+  SERIAL: (m, d) => (1 <= m && m <= 11 ? '' : '1<=M<=11'),
+  SERIAL2: () => '',
+  INTEGER: (m, d) => (1 <= m && m <= 11 ? '' : '1<=M<=11'),
+  BIGINT: (m, d) => (1 <= m && m <= 20 ? '' : '1<=M<=20'),
+  BIGSERIAL: (m, d) => (1 <= m && m <= 20 ? '' : '1<=M<=20'),
+  REAL: () => '',
+  FLOAT4: () => '',
+  FLOAT8: () => '',
+  DOUBLE: (m, d) => (1 <= m && m <= 38 && 0 <= d && d < m ? '' : '1<=M<=38,0<=D<M'),

Review Comment:
   Suggest changing the `1<=M<=38,0<=D<M` to `1 <= M <= 38, 0 <= D < M`, it's more readable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org