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-31860 Test suite for the Parquet plugin #18980

Draft
wants to merge 14 commits into
base: candidate-9.8.x
Choose a base branch
from

Conversation

ilhan2316
Copy link
Contributor

@ilhan2316 ilhan2316 commented Aug 9, 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:

@ilhan2316 ilhan2316 changed the title Hpcc 31860 parquet plugin test suite Hpcc-31860 parquet plugin test suite Aug 9, 2024
@ilhan2316 ilhan2316 force-pushed the HPCC-31860-Parquet-Plugin-Test-Suite branch from 905c5b2 to d148f19 Compare August 9, 2024 17:49
@ilhan2316 ilhan2316 changed the title Hpcc-31860 parquet plugin test suite Hpcc-31860 Test suite for the Parquet plugin Aug 9, 2024
@jackdelv jackdelv self-requested a review August 9, 2024 17:54
Copy link
Contributor

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@ilhan2316 I took a quick first look and had some questions and comments.

There were a few repeated style issues that I only pointed out a single example of, but make sure to check over all the files for things like ending newlines, correct copyright headers, etc.

Also, don't forget to remove any changes not associated with this PR.

Back to you.

testing/parquet/parquet_partition.ecl Outdated Show resolved Hide resolved
testing/parquet/parquet_partition.ecl Outdated Show resolved Hide resolved
testing/parquet/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_compress.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_write.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_schema.ecl Outdated Show resolved Hide resolved
@ilhan2316 ilhan2316 changed the title Hpcc-31860 Test suite for the Parquet plugin HPCC-31860 Test suite for the Parquet plugin Aug 12, 2024
Copy link
Contributor

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@ilhan2316 I think it is looking good. Don't be put off by the number of comments. Feel free to ask any questions that may come up.

Once you address these changes please take a look through the rest of the files to see if my comments apply in any other places. Once you are done I will look through the rest of the files.

esp/src/dgrid Outdated Show resolved Hide resolved
plugins/parquet/parquetembed.cpp Outdated Show resolved Hide resolved
plugins/parquet/parquetembed.hpp Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_compress.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_compress.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_partition.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_partition.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_schema.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_size.ecl Outdated Show resolved Hide resolved
vcpkg Outdated Show resolved Hide resolved
Copy link
Contributor

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@ilhan2316 A few more comments, but I think it is close.

testing/regress/ecl/key/parquet_partition.xml Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_compress.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_overwrite.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_partition.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_size.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
Copy link
Contributor

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@ilhan2316 I just took a look at your ECL files and have a few comments.

testing/regress/ecl/parquet_compress.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_partition.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_size.ecl Outdated Show resolved Hide resolved

outputDataset := ParquetIO.Read(recordLayout, filePath);

compareDatasets := IF(COUNT(importedDataset) = COUNT(outputDataset),
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment still stands.

############################################################################## */

//class=parquet
//Cover's data type's supported by ECL and arrow
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment still stands.

testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_write.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/upload.ecl Outdated Show resolved Hide resolved
@jackdelv
Copy link
Contributor

jackdelv commented Sep 16, 2024

@ilhan2316 This will need to be rebased to the latest version of 9.8.x to pull in the changes from this JIRA. It contains changes to data type sizes and could cause some of your key files to change.

@ilhan2316 ilhan2316 force-pushed the HPCC-31860-Parquet-Plugin-Test-Suite branch from f50a03e to 92a925a Compare September 18, 2024 03:13
Copy link
Contributor

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@ilhan2316 Don't be put off by the number of comments it is getting close. Feel free to leave questions on GitHub and I can add examples and clarification.

Some files used in your test cases are missing from the PR as well as files that are included but not referenced in your ECL. I have included the list below. Also, make sure you check back to the PR to see the results of the smoketests. Some of the test cases are failing.

Files I didn't see a reference to in the ECL:
diverse.parquet
edgecase1.parquet
intial.parquet
integertest.parquet
medium.parquet
small.parquet
time3.parquet
updated.parquet
Files missing that were referenced:
single.parquet
multi_1_of_3.parquet
multi_2_of_3.parquet
multi_3_of_3.parquet
Missing key files:
parquet_types.xml
parquet_schema.xml

testing/regress/ecl/key/parquet_empty.xml Outdated Show resolved Hide resolved
############################################################################## */

//class=parquet
//fail
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still marked fail. Try running it again as the fix should be in the latest version of 9.8.x.

ParquetIO.HivePartition.Write(
smallData,
rowSize, // Number of rows per file
'/var/lib/HPCCSystems/mydropzone/hive_partitioned/',
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Std.File.GetDefaultDropZone() + '/regress/parquet/hive_partitioned/' to avoid cluttering up the dropzone root directory and assuming the platform is installed in root.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this file, I have fixed it in terms of the partitioning I believe, but this is the current error that I am still trying to figure out : assert(!"Unknown copy source type") failed - file: hqlcpp.cpp, line 11772

Copy link
Contributor

Choose a reason for hiding this comment

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

That doesn't look like an issue with the plugin. Perhaps your ECL is still incorrect. I noted a few issues in my comments.

ParquetIO.DirectoryPartition.Write(
smallData, // Data to write
rowSize, // Number of rows per file
'/var/lib/HPCCSystems/mydropzone/dir_partitioned/',
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as line 43.

testing/regress/ecl/parquet_size.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_string.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_write.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/parquet_types.ecl Outdated Show resolved Hide resolved
testing/regress/ecl/upload.ecl Outdated Show resolved Hide resolved
Copy link
Contributor

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@ilhan2316 Before I look at the changes could you please remove the files that shouldn't be there. You can refer to my earlier comment for the list of files that should be removed.

@jackdelv
Copy link
Contributor

@ilhan2316 it looks like there are many of my comments that are still unresolved. Make sure you are going through the "Files Changed" section and opening each file to view my comments. Also, it helps me if you respond to the comments with what you changed, if you agree or disagree, or what your thoughts are rather than just resolving the thread.

Copy link
Contributor

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@ilhan2316 I know this is a lot of comments, but I think they are overall easier to fix than they have previously been. If you want me to provide some ECL for these tests let me know and I can help you. Don't hesitate to ask questions either!

testing/regress/ecl/key/parqueCorrupt.xml Show resolved Hide resolved
testing/regress/ecl/parquetEmpty.ecl Show resolved Hide resolved
basePath := Std.File.GetDefaultDropZone() + 'regress/parquet/';

// Define partition keys as string arrays
hivePartitionKey := ['city'];
Copy link
Contributor

Choose a reason for hiding this comment

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

This could easily be the cause of your error. The FUNCTIONMACROs for Write expect a string and you are passing an array. The way to pass in multiple keys is like: 'year;month;day'

rowSize := 1024; // Increased buffer size

// Define base path
basePath := Std.File.GetDefaultDropZone() + 'regress/parquet/';
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be '/regress/parquet/'.

SEQUENTIAL(
OUTPUT(singleDataset, NAMED('singleDataset')), // Output for the single file
OUTPUT(multiDataset, NAMED('multiDataset')) // Output for the combined multi-part files
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing newline character at the end of the file.


setOfIntegerResult := IF(COUNT(setOfIntegerCompareResult(isEqual = FALSE)) = 0, 'Pass', 'Fail: SET OF INTEGER data mismatch');

// ======================== REAL8 ========================
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than create a new section for each type variation you should just add an additional column to the existing REAL dataset on line 92.


setOfUnicodeResult := IF(COUNT(setOfUnicodeCompareResult(isEqual = FALSE)) = 0, 'Pass', 'Fail: SET OF UNICODE data mismatch');

// ======================== INTEGER8 ========================
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above. Add repeating types to the first section of that type as an additional field. See the DATA section as an example on line 173.

Copy link
Contributor

@jackdelv jackdelv Oct 28, 2024

Choose a reason for hiding this comment

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

To avoid making too many comments I haven't explicitly marked each occurrence, but there were a lot of the same cases that could be commoned up.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this test can be deleted. The write functionality is thoroughly tested by the other tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this file can be deleted and the functionality tested in parquetTypes.ecl (See my comment there).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I agree with you on this.

ParquetIO.HivePartition.Write(
smallData,
rowSize, // Number of rows per file
'/var/lib/HPCCSystems/mydropzone/hive_partitioned/',
Copy link
Contributor

Choose a reason for hiding this comment

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

That doesn't look like an issue with the plugin. Perhaps your ECL is still incorrect. I noted a few issues in my comments.

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