You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by GitBox <gi...@apache.org> on 2022/08/24 14:32:30 UTC

[GitHub] [systemds] Baunsgaard commented on a diff in pull request #1677: [SYSTEMDS-3413] Add support for row/col aggregation to countDistinct builtin function

Baunsgaard commented on code in PR #1677:
URL: https://github.com/apache/systemds/pull/1677#discussion_r953862878


##########
src/main/java/org/apache/sysds/runtime/instructions/SPInstructionParser.java:
##########
@@ -126,7 +126,9 @@ public class SPInstructionParser extends InstructionParser
 		String2SPInstructionType.put( "uac*"    , SPType.AggregateUnary);
 		String2SPInstructionType.put( "uatrace" , SPType.AggregateUnary);
 		String2SPInstructionType.put( "uaktrace", SPType.AggregateUnary);
-		String2SPInstructionType.put( "uacdap"  , SPType.AggregateUnary);
+		String2SPInstructionType.put( "uacd"    , SPType.AggregateUnary);
+		String2SPInstructionType.put( "uacdr"   , SPType.AggregateUnary);
+		String2SPInstructionType.put( "uacdc"   , SPType.AggregateUnary);

Review Comment:
   same here, should we add the approximate methods as well?



##########
src/test/scripts/functions/countDistinct/countDistinctRowCol.dml:
##########
@@ -0,0 +1,24 @@
+#-------------------------------------------------------------
+#
+# 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.
+#
+#-------------------------------------------------------------
+
+input = round(rand(rows = $2, cols = $3, min = 0, max = $1 -1, sparsity= $4,  seed = 7))
+res = countDistinct(input)  # default is dir="rc"

Review Comment:
   add another test for this, the call with "rc" should be equivalent to no "rc" argument.
   While it is trivial and known, it is an easy test to add and it will enforce it later on.



##########
src/main/java/org/apache/sysds/runtime/instructions/InstructionUtils.java:
##########
@@ -420,7 +421,11 @@ else if ( opcode.equalsIgnoreCase("uacmin") ) {
 			AggregateOperator agg = new AggregateOperator(Double.POSITIVE_INFINITY, Builtin.getBuiltinFnObject("min"));
 			aggun = new AggregateUnaryOperator(agg, ReduceRow.getReduceRowFnObject(), numThreads);
 		}
-		
+		else if ( opcode.equalsIgnoreCase("uacd") || opcode.equalsIgnoreCase("uacdr")
+				|| opcode.equalsIgnoreCase("uacdc") ) {

Review Comment:
   Should we add the approximate methods as well?



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org