Skip to content

Commit

Permalink
Check if column is an ID column before converting to char array
Browse files Browse the repository at this point in the history
  • Loading branch information
ritvikjaiswal committed Aug 2, 2018
1 parent 9d354f0 commit e49f806
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,8 @@ b. Dim Driven
case StrType(_, sm, _) if sm.isDefined && queryContext.requestModel.isDimDriven =>
val defaultValue = sm.get.default
s"""COALESCE(${alias}, '$defaultValue')"""
case IntType(_, _, _, _, _) | DecType(_, _, _, _, _, _) => toChar(alias)
case IntType(_, _, _, _, _) if !alias.contains("ID") => toChar(alias)
case DecType(_, _, _, _, _, _) => toChar(alias)
case DateType(fmt) if fmt.isDefined => s"to_char($alias, '${fmt.get}')"
case _ => alias
}
Expand Down

0 comments on commit e49f806

Please sign in to comment.