Weiqing Yang created SPARK-15707:
------------------------------------
Summary: Make Code Neat - Use map instead of if check
Key: SPARK-15707
URL: https://issues.apache.org/jira/browse/SPARK-15707
Project: Spark
Issue Type: Improvement
Components: SQL
Reporter: Weiqing Yang
Priority: Trivial
In forType function of object RandomDataGenerator, there is a piece of code as
following:
--------
if (maybeSqlTypeGenerator.isDefined) {
val sqlTypeGenerator = maybeSqlTypeGenerator.get
val generator = () => {
….
}
Some(generator)
} else {
None
}
-------
It is better to use maybeSqlTypeGenerator.map instead of ‘if … else …’ above
since ‘map’ has ‘if … else …’ inside itself. That will make code neat.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]