[ https://issues.apache.org/jira/browse/BEAM-7013?focusedWorklogId=292345&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-292345 ]
ASF GitHub Bot logged work on BEAM-7013: ---------------------------------------- Author: ASF GitHub Bot Created on: 09/Aug/19 23:50 Start Date: 09/Aug/19 23:50 Worklog Time Spent: 10m Work Description: robinyqiu commented on pull request #9144: [BEAM-7013] Integrating ZetaSketch's HLL++ algorithm with Beam URL: https://github.com/apache/beam/pull/9144#discussion_r312678130 ########## File path: sdks/java/extensions/zetasketch/src/test/java/org/apache/beam/sdk/extensions/zetasketch/HllCountTest.java ########## @@ -0,0 +1,373 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.extensions.zetasketch; + +import com.google.zetasketch.HyperLogLogPlusPlus; +import com.google.zetasketch.shaded.com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.apache.beam.sdk.Pipeline.PipelineExecutionException; +import org.apache.beam.sdk.testing.NeedsRunner; +import org.apache.beam.sdk.testing.PAssert; +import org.apache.beam.sdk.testing.TestPipeline; +import org.apache.beam.sdk.transforms.Create; +import org.apache.beam.sdk.values.KV; +import org.apache.beam.sdk.values.PCollection; +import org.apache.beam.sdk.values.TypeDescriptor; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Tests for {@link HllCount}. */ +@RunWith(JUnit4.class) +public class HllCountTest { Review comment: > All test cases in HllCountTest are marked as NeedsRunner, which means these tests are required to run with a runner. Thus, I don't think these tests are at UT level. Well, I agree with you that maybe we should not call these tests unit tests because they are not testing individual components and requires a runner. But according to the [Beam Contribution Testing Guide](https://cwiki.apache.org/confluence/display/BEAM/Contribution+Testing+Guide#ContributionTestingGuide-Unit), if we categorize all our tests into 3 categories, meaning unit test, ValidatesRunner test, and IT, NeedsRunner test still falls into unit test... Anyway, I will just call these tests NeedsRunner test from now on. > And if there is no test target running these tests, I'm not sure what the purpose of tests are. Actually NeedRunner tests are included in our Java Precommit tests on Jenkins (see the [test for this PR](https://builds.apache.org/job/beam_PreCommit_Java_Commit/7044/testReport/)), using DirectRunner, I think. I believe the test target running these tests is `:runners:direct-java:needsRunner`. > As I mentioned above, I totally agree it's better for us to have ITs with BQ if BQ is the major use case. But I would prefer having tests inside this PR. Otherwise, seems like we will not have any proof saying that this transform works, right? Agree. Currently there is no proof that this feature is working on DataflowRunner in the form of a test, which is not good. I will write the ITs and include them along with this PR. > How to construct tests is depended on how you scope your feature. If you think your feature is dataflow only, then you should run your tests with dataflow runner. You can try to define a test target in your module's gradle file and make it depend on dataflow-runner project, but I'm not sure whether it will introduce circular dependencies. This is how I want to add the ITs. I will define the ITs in this module instead of in `:runners:google-cloud-dataflow-java`, and add a dependency to DataflowRunner as a test dependency. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 292345) Time Spent: 11h 20m (was: 11h 10m) > A new count distinct transform based on BigQuery compatible HyperLogLog++ > implementation > ---------------------------------------------------------------------------------------- > > Key: BEAM-7013 > URL: https://issues.apache.org/jira/browse/BEAM-7013 > Project: Beam > Issue Type: New Feature > Components: extensions-java-sketching, sdk-java-core > Reporter: Yueyang Qiu > Assignee: Yueyang Qiu > Priority: Major > Fix For: 2.16.0 > > Time Spent: 11h 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.14#76016)