Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC4J-650 DFSClient should retain integer subtypes #764

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

jpmcmu
Copy link
Contributor

@jpmcmu jpmcmu commented Sep 24, 2024

  • Modified record translation code to maintain integer subtype
  • Fixed record translation test case
  • Added index record translation to test case

Signed-off-by: James McMullan [email protected]

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change is a breaking change (fix or feature that will cause existing behavior to change).

Checklist:

  • I have created a corresponding JIRA ticket for this submission
  • My code follows the code style of this project.
    • I have applied the Eclipse code-format template provided.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the HPCC Systems CONTRIBUTORS document (https://github.com/hpcc-systems/HPCC-Platform/wiki/Guide-for-contributors).
  • The change has been fully tested:
    • This change does not cause any existing JUnits to fail.
    • I have include JUnit coverage to test this change
    • I have performed system test and covered possible regressions and side effects.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Premature optimization
    • This change fixes the problem, not just the symptom

Testing:

Copy link

Jira Issue: https://hpccsystems.atlassian.net/browse/HPCC4J-650

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

@jpmcmu
Copy link
Contributor Author

jpmcmu commented Sep 24, 2024

@rpastrana Note: I am still working on correcting index record definition translation structure.

Copy link
Member

@rpastrana rpastrana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpmcmu looks good. but there's a couple of minor issues. Once resolved please squash

@@ -743,6 +760,10 @@ private static int getJsonTypeDefinition(FieldDef field, HashMap<Integer, Intege
{
char delim = 0x0001;
childJson.put("xpath", childField.getFieldName() + delim + "Row");
} else if (childField.getFieldType() == FieldType.SET)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor format issue, missing new line

@@ -743,6 +760,10 @@ private static int getJsonTypeDefinition(FieldDef field, HashMap<Integer, Intege
{
char delim = 0x0001;
childJson.put("xpath", childField.getFieldName() + delim + "Row");
} else if (childField.getFieldType() == FieldType.SET)
{
char delim = 0x0001;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it feels like this variable deserves to be a static final with an explicit self documenting name

@jpmcmu jpmcmu marked this pull request as ready for review September 27, 2024 01:49
@jpmcmu jpmcmu changed the title WIP: HPCC4J-650 DFSClient should retain integer subtypes HPCC4J-650 DFSClient should retain integer subtypes Oct 1, 2024
Copy link
Member

@rpastrana rpastrana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpmcmu just a couple of comments

* @return true when biased
* @return true when biased
*
* @deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a comment indicating which method to use instead of this deprecated method


int childTypeHash = getJsonTypeDefinition(nonKeyedField, typeDefinitionMap, typeDefinitions);
int childTypeIndex = typeDefinitionMap.get(childTypeHash);
String childTypeName = "ty" + (childTypeIndex + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's difficult to rationalize the significance of this literal "ty" let's externalize into a self documenting var

@jpmcmu
Copy link
Contributor Author

jpmcmu commented Oct 3, 2024

@rpastrana Pushed up code review changes, if it looks good will squash

- Modified record translation code to maintain integer subtype
- Fixed record translation test case
- Added index record translation to test case

Signed-off-by: James McMullan [email protected]
@rpastrana rpastrana merged commit 0eec83b into hpcc-systems:candidate-9.2.x Oct 3, 2024
3 of 5 checks passed
Copy link

github-actions bot commented Oct 3, 2024

Jirabot Action Result:
Added fix version: 9.2.128
Added fix version: 9.4.102
Added fix version: 9.6.54
Added fix version: 9.8.28
Workflow Transition: 'Resolve issue'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants