[Java] org.apache.tsfile.read.expression.impl is a private package
I'm trying to create a value filter to query data in a ts file. From all the examples I could find and a search in the source code, the only way to do this is to use something like in this example:
// value filter : device_1.sensor_2 <= 20, should select 1 2 4 6 7
IExpression valueFilter =
new SingleSeriesExpression(
new Path(DEVICE_1, SENSOR_2, true), ValueFilterApi.ltEq(1, 20L, TSDataType.INT64));
queryAndPrint(paths, readTsFile, valueFilter);
This requires importing SingleSeriesExpression from org.apache.tsfile.read.expression.impl. However, this package is not exported and is even defined as a Private-Package in the MANIFEST generated at the end of the file (at least for the tsfile.jar in the maven repo):
Private-Package: org.apache.tsfile.read.expression.impl
This seems to be the expected default behavior of the maven-bundle-plugin since it doesn't export any package with impl in the name (see here in the <Export-Package> point). However, this means that OSGI will not allow me to import this package for my application.
Is this normal? And if so, how can I create a value filter without importing this package?
It is not expected.
For now, we should modify the pom to allow exporting org.apache.tsfile.read.expression.impl. And in the future, we may provide a factory class for this.
Are you interested in creating a pull request to help us with this?
Thank you for your reply.
That makes sense. I'll look into it to export this package properly for the moment and then make a PR.
I hadn't noticed the previous merge of #510, but this PR also fixes that problem as all packages were explicitly exported by Export-Package in the MANIFEST, including org.apache.tsfile.read.expression.impl.
However, I still created a small PR (#556) to correct the unnecessary declaration of private packages (which had no effect anyway).
Great, thanks for your contribution.