I am trying to use function ft_elementwise_product which is supposed to make elementwise product, but I can´t, here is a link explaining how the function should work:
http://rstudio.github.io/sparklyr/reference/ft_elementwise_product.html
Having this example:
library(sparklyr)
library(dplyr)
sc <- spark_connect(master = "local")
iris2 = copy_to(sc, iris, "iris2", overwrite = TRUE)
I wanted to multiply Sepal_Length with Sepal_Width, so I tried:
ft_elementwise_product(iris2, Sepal_Length, Sepal_Width, Sepal_Width)
# object 'Sepal_Length' not found
ft_elementwise_product(iris2, "Sepal_Length", Sepal_Width, Sepal_Width)
# object 'Sepal_Width' not found
ft_elementwise_product(iris2, "Sepal_Length", "Sepal_Width", Sepal_Width)
# Error in object %||% default : object 'Sepal_Width' not found
ft_elementwise_product(iris2, "Sepal_Length", "Sepal_Width", "Sepal_Width")
# Error: java.lang.Exception: No matched method found for class org.apache.spark.ml.feature.ElementwiseProduct.setScalingVec
ft_elementwise_product(iris2, "Sepal_Length", "Sepal_Width", "Sepal_Length")
# Error: java.lang.Exception: No matched method found for class org.apache.spark.ml.feature.ElementwiseProduct.setScalingVec
ft_elementwise_product(iris2, "Sepal_Length", "result", "Sepal_Length")
# Error: java.lang.Exception: No matched method found for class org.apache.spark.ml.feature.ElementwiseProduct.setScalingVec
iris2 = mutate(iris2, result = 0)
ft_elementwise_product(iris2, "Sepal_Length", "result", "Sepal_Length")
# Error: java.lang.Exception: No matched method found for class org.apache.spark.ml.feature.ElementwiseProduct.setScalingVec