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

HPCC-32558 Parquet plugin not utilizing Decimal encoding #19141

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

jackdelv
Copy link
Contributor

@jackdelv jackdelv commented Sep 23, 2024

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 improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • 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 CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

Copy link

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32558

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

Copy link
Contributor

@dcamper dcamper left a comment

Choose a reason for hiding this comment

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

Approved, with a couple of very minor comments.

}

/**
* @brief Calls processDecimal since unsigned decimals still have a max of 64 digits with 32 digits of precision.
Copy link
Contributor

Choose a reason for hiding this comment

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

Trivial: Function does not seem to call processDecimal().

* @brief Calls processDecimal since unsigned decimals still have a max of 64 digits with 32 digits of precision.
*
* @param value Data to be written to the Parquet file.
* @param digits Number of bytes holding the digits.
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: An argument named 'digits' makes me think "number of base-10 digits in the value." Perhaps I am the only one that thinks like that but if not: Renaming that argument for clarity may be in order.

Copy link
Contributor

Choose a reason for hiding this comment

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

Previous comment replicated to processDecimal() as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your comment as I expected the same thing. The digits name is defined in the IFieldProcessor Interface. Would this require renaming all instances of digits in the code where IFieldProcessor is implemented?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, never mind then. If this was purely local to your code then the rename may be in order. If it is part of the de facto standard in the rest of the code then it's better that it stays this way. Thanks!

Copy link
Contributor

@dcamper dcamper left a comment

Choose a reason for hiding this comment

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

Looks good.

@jackdelv
Copy link
Contributor Author

@ghalliday Please take a look.

}], layout);

overwriteOption := TRUE;
ParquetIO.Write(decimal_data, '/home/jack/dev/debug/etc/HPCCSystems/mydropzone/regress/parquet/decimal.parquet', overwriteOption);
Copy link
Member

Choose a reason for hiding this comment

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

This does not pass the smoketest because it is a reference to a file path that does not exist. This probably needs to be hthor only and use a local relative filename.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed test file tags to exclude it from running on Thor and Roxie.

The Arrow library does not support creating arrow::fs::Filesystems with relative paths. It would be possible to add support if the plugin was able to get the path context from somewhere else and add it to the relative path, but for now I have set the path where the test files are created to '/etc/HPCCSystems/mydropzone/regress/decimal.parquet'. Is this appropriate or would a more general location like '/tmp/decimal.parquet' be better?

@@ -37,9 +37,9 @@ decimal_data := DATASET([{(DECIMAL) '0.12345678901234567890123456789012',
}], layout);

overwriteOption := TRUE;
ParquetIO.Write(decimal_data, '/home/jack/dev/debug/etc/HPCCSystems/mydropzone/regress/parquet/decimal.parquet', overwriteOption);
ParquetIO.Write(decimal_data, '/etc/HPCCSystems/mydropzone/regress/decimal.parquet', overwriteOption);
Copy link
Member

Choose a reason for hiding this comment

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

Better, but I don't think this is the correct path though. I think it should be

/var/lib/HPCCSystems/mydropzone/regress/...

Also, that assumes that the system has been installed in the root directory - that isn't the case for many developers. @jakesmith can you think of a clean way of doing this?

Copy link
Member

Choose a reason for hiding this comment

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

@jackdelv - you could use Std.File.GetDefaultDropZone (or potentially Std.File.GetLandingZones if you needed >1 and/or more detail)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to use Std.File.GetDefaultDropZone to prefix the file name with a valid dropzone directory.

Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

Please squash and I will merge

Signed-off-by: Jack Del Vecchio <jack.delvecchio@lexisnexisrisk.com>
@jackdelv
Copy link
Contributor Author

@ghalliday Squashed.

@ghalliday ghalliday merged commit 9ce53c6 into hpcc-systems:candidate-9.8.x Sep 26, 2024
47 checks passed
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.

4 participants