From 5d55c704b0e124c66edb1093f4e152e2d34188fc Mon Sep 17 00:00:00 2001 From: David Bures Date: Wed, 4 May 2016 00:24:47 +0200 Subject: [PATCH 1/3] fix-518 store to VIN shorter message if parsing failed --- src/OBDLibrary/ObdShare/ObdUtil.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OBDLibrary/ObdShare/ObdUtil.cs b/src/OBDLibrary/ObdShare/ObdUtil.cs index 29ad20e3..a332576d 100644 --- a/src/OBDLibrary/ObdShare/ObdUtil.cs +++ b/src/OBDLibrary/ObdShare/ObdUtil.cs @@ -110,7 +110,7 @@ public static string ParseVINMsg(string result) //VIN } catch (Exception exp) { - return exp.Message; + return "PARSING FAILED"; } } From ceeae737a92b2dfa322ae260fc2f96c1112bccba Mon Sep 17 00:00:00 2001 From: David Bures Date: Wed, 4 May 2016 00:35:41 +0200 Subject: [PATCH 2/3] fix-518 handle long VIN (with exception message) --- src/HDInsight/hivescripts/TripDataInt.hql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HDInsight/hivescripts/TripDataInt.hql b/src/HDInsight/hivescripts/TripDataInt.hql index 2ca9ecbf..206f3d73 100644 --- a/src/HDInsight/hivescripts/TripDataInt.hql +++ b/src/HDInsight/hivescripts/TripDataInt.hql @@ -39,7 +39,7 @@ Runtime int INSERT INTO TABLE tripDataInt SELECT TripId, UserId, -vin, +SUBSTR(vin, 0, 20) as vin, UNIX_TIMESTAMP(CONCAT(SPLIT(RecordedTimeStamp,'T')[0],' ',SUBSTR(SPLIT(RecordedTimeStamp,'T')[1],0,8)),'yyyy-MM-dd hh:mm:ss') as unixtimestamp, AVG(Lat) as cLat, AVG(Lon) as cLon, From 70c3d201f0402a151887cc66ba0fdd93a8be9852 Mon Sep 17 00:00:00 2001 From: David Bures Date: Wed, 4 May 2016 02:05:25 +0200 Subject: [PATCH 3/3] fix-518 handle long VIN (with exception message) --- src/HDInsight/hivescripts/dimUserUpdate.hql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HDInsight/hivescripts/dimUserUpdate.hql b/src/HDInsight/hivescripts/dimUserUpdate.hql index d263d481..1d96403e 100644 --- a/src/HDInsight/hivescripts/dimUserUpdate.hql +++ b/src/HDInsight/hivescripts/dimUserUpdate.hql @@ -10,6 +10,6 @@ LOCATION 'wasb://tripdata@${hiveconf:DataStorageAccount}.blob.core.windows.net/t INSERT INTO TABLE dimUser SELECT distinct UserId, -IF(vin is NULL,"Unknown",vin) as vin +IF(vin is NULL,"Unknown",SUBSTR(vin, 0, 20)) as vin FROM tripdata WHERE year=${hiveconf:Year} and month=${hiveconf:Month} and day=${hiveconf:Day} and TripId is not null and TripId!='' and UserId is not null and UserId != ''; \ No newline at end of file