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

[Kernel] Clean up package organization of kernel-default module. #1954

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

vkorukanti
Copy link
Collaborator

@vkorukanti vkorukanti commented Aug 1, 2023

Description

Rename the module kernel-default to kernel-defaults.
Rename package io.delta.kernel to io.delta.kernel.defaults in kernel-defaults module.
Move non-public classes under the io.delta.kernel.defaults.internal package.

Note: Reason for not using the default is because it is a keyword in Java and can't be part of the package namespace.

How was this patch tested?

Updated the kernel/examples and ran the python3 kernel/examples/run-kernel-examples.py --use-local successfully.

import io.delta.kernel.expressions.Expression;
import io.delta.kernel.expressions.ExpressionEvaluator;
import io.delta.kernel.expressions.Literal;
import io.delta.kernel.types.*;
import io.delta.kernel.types.BinaryType;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't have a checkstyle rule to collapse these together.

@jaceklaskowski
Copy link
Contributor

Please use io.delta.kernel.default (singular not plural) 🙏 That would make more sense to me given the package name is kernel-default. Just like org.apache.spark.sql not org.apache.spark.sqls 😉

@vkorukanti
Copy link
Collaborator Author

Please use io.delta.kernel.default (singular not plural) 🙏 That would make more sense to me given the package name is kernel-default. Just like org.apache.spark.sql not org.apache.spark.sqls 😉

Agree it is big odd, unfortunately default is a keyword in Java and can't be used within the package namespace. Updated the PR to rename the module to kernel-defaults so that they are in sync. Also this module contains default implementations of multiple clients such as DefaultExpressionHandler, DefaultParquetHandler etc. Let me know if there are any issues or better naming alternatives.

import io.delta.kernel.types.StructField;
import io.delta.kernel.types.StructType;

import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
import io.delta.kernel.defaults.internal.data.vector.VectorUtils;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: internal second?

@@ -40,7 +42,10 @@
import io.delta.kernel.types.StructType;
import io.delta.kernel.utils.CloseableIterator;
import io.delta.kernel.utils.Utils;
import static io.delta.kernel.utils.DefaultKernelTestUtils.getTestResourceFilePath;

import io.delta.kernel.defaults.utils.DefaultKernelTestUtils;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: no new line? we can't actually enforce this I think

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I modified the import order in Intellij to remove the blank line.

Copy link
Collaborator

@allisonport-db allisonport-db left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants