实现etl中的数据转换
package com.yst.core.parser
import java.util.Map
import java.util.HashMap
import scala.util.parsing.json._
import java.text.SimpleDateFormat
import java.util.Date
import java.util.TimeZone
import java.text.ParseException
/**
* 转换函数
*/
class FormatFunParser(map:Map[String,Object]) extends FunParser(map){
/**
* 数值乘
*
* targetFields_multi('a,b',100)={
* val key1 =a;
* val value1 = map.get(a)
* val mvalue1 = value*100
*
* val key2 =a;
* val value2 = map.get(a)
* val mvalue2 = value2*100
*
* val retmap= new HashMap()
* retmap.put(key1,mvalue1)
* retmap.put(key2,mvalue2)
* }
*
*/
def targetFields_multi:Parser[Map[String,Object]]="targetFields_multi("~>jtxt~","~wholeNumber<~")"^^{
case pkey~comma~num=>{
val retmap= new HashMap[String,Object]
val numInteger = Integer.valueOf(num)
var ret:Object=null
pkey.toString().split(",").foreach(f=>{
val value = map.get(f)
var valueInteger =Integer.valueOf("0")
i