|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ZKLT.Hadoop.Model
|
|
|
|
namespace ZKLT.Hadoop.Model
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -42,5 +43,35 @@ namespace ZKLT.Hadoop.Model
|
|
|
|
return action;
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 列转换
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="column">列</param>
|
|
|
|
|
|
|
|
/// <param name="param">参数</param>
|
|
|
|
|
|
|
|
/// <param name="action">公式</param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public static string ColConvert(HDP_Column column, Dictionary<string, object> param,object value) {
|
|
|
|
|
|
|
|
string _guid;
|
|
|
|
|
|
|
|
if (value is string) {
|
|
|
|
|
|
|
|
string _action = value.ToString()!;
|
|
|
|
|
|
|
|
Regex _regex1 = new Regex(@"(?<=(\+\=))\d+");
|
|
|
|
|
|
|
|
if(_regex1.IsMatch(_action))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_guid = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
param.Add(_guid,_regex1.Match(_action).Value);
|
|
|
|
|
|
|
|
return @$"`{column.Key}` + @{_guid}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Regex _regex2 = new Regex(@"(?<=(\-\=))\d+");
|
|
|
|
|
|
|
|
if (_regex2.IsMatch(_action))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_guid = Guid.NewGuid().ToString("N");
|
|
|
|
|
|
|
|
param.Add(_guid, _regex2.Match(_action).Value);
|
|
|
|
|
|
|
|
return @$"`{column.Key}` - @{_guid}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
param.Add(column.Key!, value);
|
|
|
|
|
|
|
|
return $@"@{column.Key}";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|