Github user BryanCutler commented on a diff in the pull request: https://github.com/apache/spark/pull/20285#discussion_r162144090 --- Diff: docs/ml-features.md --- @@ -1283,6 +1283,48 @@ for more details on the API. </div> </div> +## VectorSizeHint + +It can sometimes be useful to explicitly specify the size of the vectors an a column of +`VectorType`. For example, `VectorAssembler` uses size information from its input columns to +produce size information and metadata for its output column. While in some cases this information +can be obtained by inspecting the contents of the column, in a streaming dataframe the contents are +not available until the stream is started. `VectorSizeHint` allows a user to explicitly specify the +vector size for a column so that `VectorAssembler`, or other transformers that might +need to know vector size, can use that column as an input. + +To use `VectorSizeHint` a user must set the `inputCol` and `size` parameters. Applying this +transformer to a dataframe produces a new dataframe with updated metadata for `inputCol` specifying +the vector size. Downstream operations on the resulting dataframe can get this size using the +meatadata. + +`VectorSizeHint` can also take an optional `handleInvalid` parameter which controls its +behaviour when the vector column contains nulls for vectors of the wrong size. By default --- End diff -- typo: 'nulls for vectors..' -> 'nulls or vectors'
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org