Parcourir la source

Se actualizó la conexión a la base de datos PRD_ORION

oscarleiva il y a 6 ans
Parent
commit
21e24c080f
2 fichiers modifiés avec 224 ajouts et 176 suppressions
  1. 176 176
      etl-weather-forecast/execute-request.ktr
  2. 48 0
      tables/CREATE_PRONOSTICO_HORARIO_PRD.sql

+ 176 - 176
etl-weather-forecast/execute-request.ktr

@@ -436,14 +436,14 @@
   <notepads>
   </notepads>
   <connection>
-    <name>DEV_MEIntegrado_AZURE</name>
+    <name>PRD_ORION_AZURE</name>
     <server>192.168.100.4</server>
     <type>MSSQLNATIVE</type>
     <access>Native</access>
-    <database>DEV_MEIntegrado</database>
+    <database>PRD_ORION</database>
     <port>1433</port>
-    <username>MERELEC_TABLEAU</username>
-    <password>Encrypted 2be98afc827948087aa1da1638dc2ff8a</password>
+    <username>MERELEC_PDI</username>
+    <password>Encrypted 2bec8eb8127c28081a71cad348cc2fe82</password>
     <servername/>
     <data_tablespace/>
     <index_tablespace/>
@@ -535,6 +535,52 @@
       <enabled>Y</enabled>
     </hop>
   </order>
+  <step>
+    <name>Filter rows</name>
+    <type>FilterRows</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <send_true_to>Table output</send_true_to>
+    <send_false_to/>
+    <compare>
+      <condition>
+        <negated>N</negated>
+        <conditions>
+          <condition>
+            <negated>N</negated>
+            <leftvalue>time_hmi</leftvalue>
+            <function>&gt;=</function>
+            <rightvalue>fecha_mañana</rightvalue>
+          </condition>
+          <condition>
+            <negated>N</negated>
+            <operator>AND</operator>
+            <leftvalue>time_hmi</leftvalue>
+            <function>&lt;</function>
+            <rightvalue>fecha_pasado</rightvalue>
+          </condition>
+        </conditions>
+      </condition>
+    </compare>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>992</xloc>
+      <yloc>128</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
   <step>
     <name>Get rows from result</name>
     <type>RowsFromResult</type>
@@ -817,6 +863,101 @@
       <draw>Y</draw>
     </GUI>
   </step>
+  <step>
+    <name>JSON Input 2</name>
+    <type>JsonInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <include>N</include>
+    <include_field/>
+    <rownum>N</rownum>
+    <addresultfile>N</addresultfile>
+    <readurl>N</readurl>
+    <removeSourceField>N</removeSourceField>
+    <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+    <doNotFailIfNoFile>Y</doNotFailIfNoFile>
+    <ignoreMissingPath>Y</ignoreMissingPath>
+    <defaultPathLeafToNull>Y</defaultPathLeafToNull>
+    <rownum_field/>
+    <file>
+      <name>C:\Users\BI4\Documents\Development\PDI - Kettle\weather-darksky\san-salvador-forecast.json</name>
+      <filemask/>
+      <exclude_filemask/>
+      <file_required>N</file_required>
+      <include_subfolders>N</include_subfolders>
+    </file>
+    <fields>
+      <field>
+        <name>latitude</name>
+        <path>$.latitude</path>
+        <type>Number</type>
+        <format/>
+        <currency/>
+        <decimal/>
+        <group/>
+        <length>-1</length>
+        <precision>-1</precision>
+        <trim_type>none</trim_type>
+        <repeat>N</repeat>
+      </field>
+      <field>
+        <name>longitude</name>
+        <path>$.longitude</path>
+        <type>Number</type>
+        <format/>
+        <currency/>
+        <decimal/>
+        <group/>
+        <length>-1</length>
+        <precision>-1</precision>
+        <trim_type>none</trim_type>
+        <repeat>N</repeat>
+      </field>
+      <field>
+        <name>hourly</name>
+        <path>$.hourly</path>
+        <type>String</type>
+        <format/>
+        <currency/>
+        <decimal/>
+        <group/>
+        <length>-1</length>
+        <precision>-1</precision>
+        <trim_type>none</trim_type>
+        <repeat>N</repeat>
+      </field>
+    </fields>
+    <limit>0</limit>
+    <IsInFields>Y</IsInFields>
+    <IsAFile>N</IsAFile>
+    <valueField>result_json</valueField>
+    <shortFileFieldName/>
+    <pathFieldName/>
+    <hiddenFieldName/>
+    <lastModificationTimeFieldName/>
+    <uriNameFieldName/>
+    <rootUriNameFieldName/>
+    <extensionFieldName/>
+    <sizeFieldName/>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>496</xloc>
+      <yloc>128</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
   <step>
     <name>Modified Java Script Value</name>
     <type>ScriptValueMod</type>
@@ -939,177 +1080,6 @@ var date5 = truncDate(dateTime, 5); // gives back today at yyyy/01/01 00:00:00.0
       <draw>Y</draw>
     </GUI>
   </step>
-  <step>
-    <name>JSON Input 2</name>
-    <type>JsonInput</type>
-    <description/>
-    <distribute>Y</distribute>
-    <custom_distribution/>
-    <copies>1</copies>
-    <partitioning>
-      <method>none</method>
-      <schema_name/>
-    </partitioning>
-    <include>N</include>
-    <include_field/>
-    <rownum>N</rownum>
-    <addresultfile>N</addresultfile>
-    <readurl>N</readurl>
-    <removeSourceField>N</removeSourceField>
-    <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
-    <doNotFailIfNoFile>Y</doNotFailIfNoFile>
-    <ignoreMissingPath>Y</ignoreMissingPath>
-    <defaultPathLeafToNull>Y</defaultPathLeafToNull>
-    <rownum_field/>
-    <file>
-      <name>C:\Users\BI4\Documents\Development\PDI - Kettle\weather-darksky\san-salvador-forecast.json</name>
-      <filemask/>
-      <exclude_filemask/>
-      <file_required>N</file_required>
-      <include_subfolders>N</include_subfolders>
-    </file>
-    <fields>
-      <field>
-        <name>latitude</name>
-        <path>$.latitude</path>
-        <type>Number</type>
-        <format/>
-        <currency/>
-        <decimal/>
-        <group/>
-        <length>-1</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-        <repeat>N</repeat>
-      </field>
-      <field>
-        <name>longitude</name>
-        <path>$.longitude</path>
-        <type>Number</type>
-        <format/>
-        <currency/>
-        <decimal/>
-        <group/>
-        <length>-1</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-        <repeat>N</repeat>
-      </field>
-      <field>
-        <name>hourly</name>
-        <path>$.hourly</path>
-        <type>String</type>
-        <format/>
-        <currency/>
-        <decimal/>
-        <group/>
-        <length>-1</length>
-        <precision>-1</precision>
-        <trim_type>none</trim_type>
-        <repeat>N</repeat>
-      </field>
-    </fields>
-    <limit>0</limit>
-    <IsInFields>Y</IsInFields>
-    <IsAFile>N</IsAFile>
-    <valueField>result_json</valueField>
-    <shortFileFieldName/>
-    <pathFieldName/>
-    <hiddenFieldName/>
-    <lastModificationTimeFieldName/>
-    <uriNameFieldName/>
-    <rootUriNameFieldName/>
-    <extensionFieldName/>
-    <sizeFieldName/>
-    <cluster_schema/>
-    <remotesteps>
-      <input>
-      </input>
-      <output>
-      </output>
-    </remotesteps>
-    <GUI>
-      <xloc>496</xloc>
-      <yloc>128</yloc>
-      <draw>Y</draw>
-    </GUI>
-  </step>
-  <step>
-    <name>Select values</name>
-    <type>SelectValues</type>
-    <description/>
-    <distribute>Y</distribute>
-    <custom_distribution/>
-    <copies>1</copies>
-    <partitioning>
-      <method>none</method>
-      <schema_name/>
-    </partitioning>
-    <fields>
-      <select_unspecified>N</select_unspecified>
-      <remove>
-        <name>time</name>
-      </remove>
-    </fields>
-    <cluster_schema/>
-    <remotesteps>
-      <input>
-      </input>
-      <output>
-      </output>
-    </remotesteps>
-    <GUI>
-      <xloc>880</xloc>
-      <yloc>128</yloc>
-      <draw>Y</draw>
-    </GUI>
-  </step>
-  <step>
-    <name>Filter rows</name>
-    <type>FilterRows</type>
-    <description/>
-    <distribute>Y</distribute>
-    <custom_distribution/>
-    <copies>1</copies>
-    <partitioning>
-      <method>none</method>
-      <schema_name/>
-    </partitioning>
-    <send_true_to>Table output</send_true_to>
-    <send_false_to/>
-    <compare>
-      <condition>
-        <negated>N</negated>
-        <conditions>
-          <condition>
-            <negated>N</negated>
-            <leftvalue>time_hmi</leftvalue>
-            <function>&gt;=</function>
-            <rightvalue>fecha_mañana</rightvalue>
-          </condition>
-          <condition>
-            <negated>N</negated>
-            <operator>AND</operator>
-            <leftvalue>time_hmi</leftvalue>
-            <function>&lt;</function>
-            <rightvalue>fecha_pasado</rightvalue>
-          </condition>
-        </conditions>
-      </condition>
-    </compare>
-    <cluster_schema/>
-    <remotesteps>
-      <input>
-      </input>
-      <output>
-      </output>
-    </remotesteps>
-    <GUI>
-      <xloc>992</xloc>
-      <yloc>128</yloc>
-      <draw>Y</draw>
-    </GUI>
-  </step>
   <step>
     <name>REST Client</name>
     <type>Rest</type>
@@ -1161,6 +1131,36 @@ var date5 = truncDate(dateTime, 5); // gives back today at yyyy/01/01 00:00:00.0
       <draw>Y</draw>
     </GUI>
   </step>
+  <step>
+    <name>Select values</name>
+    <type>SelectValues</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <fields>
+      <select_unspecified>N</select_unspecified>
+      <remove>
+        <name>time</name>
+      </remove>
+    </fields>
+    <cluster_schema/>
+    <remotesteps>
+      <input>
+      </input>
+      <output>
+      </output>
+    </remotesteps>
+    <GUI>
+      <xloc>880</xloc>
+      <yloc>128</yloc>
+      <draw>Y</draw>
+    </GUI>
+  </step>
   <step>
     <name>Table output</name>
     <type>TableOutput</type>
@@ -1172,7 +1172,7 @@ var date5 = truncDate(dateTime, 5); // gives back today at yyyy/01/01 00:00:00.0
       <method>none</method>
       <schema_name/>
     </partitioning>
-    <connection>DEV_MEIntegrado_AZURE</connection>
+    <connection>PRD_ORION_AZURE</connection>
     <schema>CLIMA</schema>
     <table>PRONOSTICO_HORARIO</table>
     <commit>1000</commit>

+ 48 - 0
tables/CREATE_PRONOSTICO_HORARIO_PRD.sql

@@ -0,0 +1,48 @@
+USE [PRD_ORION]
+GO
+
+/****** Object:  Table [CLIMA].[PRONOSTICO_HORARIO]    Script Date: 30/01/2019 14:54:34 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+SET ANSI_PADDING ON
+GO
+
+CREATE TABLE [CLIMA].[PRONOSTICO_HORARIO](
+	[FECHA] [datetime] NOT NULL,
+	[PAIS] [varchar](50) NOT NULL,
+	[CIUDAD] [varchar](50) NOT NULL,
+	[LATITUD] [float] NOT NULL,
+	[LONGITUD] [float] NOT NULL,
+	[PRECIP_INTENSITY] [float] NULL,
+	[PRECIP_PROBABILITY] [float] NULL,
+	[PRECIP_TYPE] [varchar](50) NULL,
+	[TEMPERATURE] [float] NULL,
+	[APPARENT_TEMPERATURE] [float] NULL,
+	[HUMIDITY] [float] NULL,
+	[PRESSURE] [float] NULL,
+	[WIND_SPEED] [float] NULL,
+	[WIND_GUST] [float] NULL,
+	[WIND_BEARING] [float] NULL,
+	[CLOUD_COVER] [float] NULL,
+	[SUMMARY] [varchar](50) NULL,
+	[ICON] [varchar](50) NULL,
+	[WHO_INAME_M] [varchar](20) NULL CONSTRAINT [CNST_CONC_DIARIA_IMPORTACION_AUDIT_NAME_I]  DEFAULT (suser_sname()),
+	[WHO_IDATE_M] [datetime] NULL CONSTRAINT [CNST_CONC_DIARIA_IMPORTACION_AUDIT_FECHA_I]  DEFAULT (getdate()),
+ CONSTRAINT [IX_PRONOSTICO_HORARIO] UNIQUE NONCLUSTERED 
+(
+	[FECHA] ASC,
+	[PAIS] ASC,
+	[CIUDAD] ASC
+)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+SET ANSI_PADDING OFF
+GO
+
+