Skip to content

Conversation

mengxr
Copy link
Contributor

@mengxr mengxr commented Apr 28, 2015

Cast numeric types to String for indexing. Boolean type is not handled in this PR. @jkbradley

val inputColName = map(inputCol)
val inputDataType = schema(inputColName).dataType
require(inputDataType == StringType || inputDataType.isInstanceOf[NumericType],
s"The input column $inputColName must be either string type or numeric type.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State actual type

@jkbradley
Copy link
Member

LGTM other than the 1 comment

@SparkQA
Copy link

SparkQA commented Apr 28, 2015

Test build #31155 has finished for PR 5753 at commit ad938bf.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@SparkQA
Copy link

SparkQA commented Apr 28, 2015

Test build #31177 has finished for PR 5753 at commit 2e34f3c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@jkbradley
Copy link
Member

LGTM I'll merge this into master

@asfgit asfgit closed this in d36e673 Apr 29, 2015
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 14, 2015
Cast numeric types to String for indexing. Boolean type is not handled in this PR. jkbradley

Author: Xiangrui Meng <[email protected]>

Closes apache#5753 from mengxr/SPARK-6965 and squashes the following commits:

2e34f3c [Xiangrui Meng] add actual type in the error message
ad938bf [Xiangrui Meng] StringIndexer handles numeric input.
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
Cast numeric types to String for indexing. Boolean type is not handled in this PR. jkbradley

Author: Xiangrui Meng <[email protected]>

Closes apache#5753 from mengxr/SPARK-6965 and squashes the following commits:

2e34f3c [Xiangrui Meng] add actual type in the error message
ad938bf [Xiangrui Meng] StringIndexer handles numeric input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants