Difference between revisions of "Talk:Data Warehouse"

From HiveTool
Jump to: navigation, search
(Created page with "I've written 2 queries to convert the temperatures. They will only process rows in which ??_temp_c is not NULL and ??_temp_f is still NULL. to make sure we don't do the same...")
 
Line 2: Line 2:
 
process rows in which ??_temp_c is not NULL and ??_temp_f is still NULL.  
 
process rows in which ??_temp_c is not NULL and ??_temp_f is still NULL.  
 
to make sure we don't do the same thing twice. I does seem that the  
 
to make sure we don't do the same thing twice. I does seem that the  
ambient temp values are sometimes a bit of the scale ("999.9"), Do I ned
+
ambient temp values are sometimes a bit of the scale ("999.9"), Do I need
 
to include some kind of lower and upper limit to skip those? Or do we do  
 
to include some kind of lower and upper limit to skip those? Or do we do  
 
some kind of basic sanity checking at some other time.
 
some kind of basic sanity checking at some other time.
Line 18: Line 18:
 
  Rows matched: 3682033  Changed: 3682033  Warnings: 2445369
 
  Rows matched: 3682033  Changed: 3682033  Warnings: 2445369
  
No sure where the warnings come from tough.
+
No sure where the warnings come from though.
  
 
for easy execution:
 
for easy execution:

Revision as of 04:28, 31 December 2015

I've written 2 queries to convert the temperatures. They will only process rows in which ??_temp_c is not NULL and ??_temp_f is still NULL. to make sure we don't do the same thing twice. I does seem that the ambient temp values are sometimes a bit of the scale ("999.9"), Do I need to include some kind of lower and upper limit to skip those? Or do we do some kind of basic sanity checking at some other time.

I've directly updated the HIVE_DATA table, I hope that's fine?

mysql> update HIVE_DATA set hive_temp_f = (hive_temp_c * 1.8) + 32 where 
hive_temp_c is not NULL and hive_temp_f is NULL;
Query OK, 0 rows affected, 65535 warnings (11.07 sec)
Rows matched: 4270276  Changed: 0  Warnings: 3279801
mysql> update HIVE_DATA set ambient_temp_f = (ambient_temp_c * 1.8) + 32 
where ambient_temp_c is not NULL and ambient_temp_f is  NULL;
Query OK, 3682033 rows affected, 65535 warnings (16.86 sec)
Rows matched: 3682033  Changed: 3682033  Warnings: 2445369

No sure where the warnings come from though.

for easy execution:

centesb7@centerforhoneybeeresearch.org [~]#  mysql --verbose -p <  
CelciusToFarenheit.sql
Enter password:

update HIVE_DATA set hive_temp_f = (hive_temp_c * 1.8) + 32 where 
hive_temp_c is not NULL and hive_temp_f is NULL


update HIVE_DATA set ambient_temp_f = (ambient_temp_c * 1.8) + 32 where 
ambient_temp_c is not NULL and ambient_temp_f is  NULL

centesb7@centerforhoneybeeresearch.org [~]# centesb7@centerforhoneybeeresearch.org [~]# cat CelciusToFarenheit.sql use centesb7_hivetool_converted;

update HIVE_DATA set hive_temp_f = (hive_temp_c * 1.8) + 32 where 
hive_temp_c is not NULL and hive_temp_f is NULL;
update HIVE_DATA set ambient_temp_f = (ambient_temp_c * 1.8) + 32 where 
ambient_temp_c is not NULL and ambient_temp_f is  NULL;