Copilot commented on code in PR #17566:
URL: https://github.com/apache/pinot/pull/17566#discussion_r2728553484
##########
pinot-controller/src/main/resources/app/utils/Utils.tsx:
##########
@@ -341,9 +342,9 @@ const syncTableSchemaData = (data, showFieldType) => {
const columnList = [...dimensionFields, ...metricFields, ...dateTimeField,
...complexFields];
if (showFieldType) {
return {
- columns: ['Column', 'Type', 'Field Type', 'Multi Value'],
+ columns: ['Column', 'Type', 'Field Type', 'Multi Value', 'Primary Key'],
records: columnList.map((field) => {
- return [field.name, field.dataType, field.fieldType,
getMultiValueField(field)];
+ return [field.name, field.dataType, field.fieldType,
getMultiValueField(field), primaryKeys.has(field.name)];
Review Comment:
The primary key value is returned as a boolean (true/false) which is
inconsistent with the 'Multi Value' column that uses `getMultiValueField()`.
Consider creating a similar helper function like `getPrimaryKeyValue()` to
maintain consistency in how boolean values are formatted and displayed across
columns.
##########
pinot-controller/src/main/resources/app/utils/Utils.tsx:
##########
@@ -341,9 +342,9 @@ const syncTableSchemaData = (data, showFieldType) => {
const columnList = [...dimensionFields, ...metricFields, ...dateTimeField,
...complexFields];
if (showFieldType) {
return {
- columns: ['Column', 'Type', 'Field Type', 'Multi Value'],
+ columns: ['Column', 'Type', 'Field Type', 'Multi Value', 'Primary Key'],
records: columnList.map((field) => {
- return [field.name, field.dataType, field.fieldType,
getMultiValueField(field)];
+ return [field.name, field.dataType, field.fieldType,
getMultiValueField(field), primaryKeys.has(field.name)];
Review Comment:
The primary key column only appears when `showFieldType` is true, but
there's no corresponding update for the case when `showFieldType` is false.
This creates an inconsistent API where the primary key information is
conditionally available. Consider adding the primary key column to both code
paths to ensure consistent data structure.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]