failed to schedual xaction file for run PDI job - pentaho

I want to run my Pentaho-data-integration job with xaction file.
my job(schedualeJob.kjb) has one transformation(repository2.ktr)( without any schedule).
the contetnt of my schedule.xaction file is:
<?xml version="1.0" encoding="UTF-8"?>
<action-sequence>
<title>My scheduled job</title>
<version>1</version>
<logging-level>ERROR</logging-level>
<documentation>
<author>mzy</author>
<description>Sequence for running daily job.</description>
<help/>
<result-type/>
<icon/>
</documentation>
<inputs>
</inputs>
<outputs>
<logResult type="string">
<destinations>
<response>content</response>
</destinations>
</logResult>
</outputs>
<resources>
<job-file>
<solution-file>
<location>schedualeJob.kjb</location>
<mime-type>text/xml</mime-type>
</solution-file>
</job-file>
</resources>
<actions>
<action-definition>
<component-name>KettleComponent</component-name>
<action-type>Pentaho Data Integration Job</action-type>
<action-inputs>
</action-inputs>
<action-resources>
<job-file type="resource"/>
</action-resources>
<action-outputs>
<kettle-execution-log type="string" mapping="logResult"/>
<kettle-execution-status type="string" mapping="statusResult"/>
</action-outputs>
<component-definition>
<kettle-logging-level><![CDATA[info]]></kettle-logging-level>
</component-definition>
</action-definition>
</actions>
</action-sequence>
I uploaded all of these 3 file in my Pentaho cde repository(beside of my report).
and set schedule for schedule.xaction file from pentaho cde. but the schedule does not run correctly. any body can help me?

Related

"file or LOB operation FILEOPEN failed" when loading an XML file into a table

I am using 11gr2 and trying to load an XML file into a table.
Here is the code:
connected as sys:
GRANT ALL ON DIRECTORY XMLDIR TO user_1;
switch to user_1:
CREATE TABLE mytable1 (key_column VARCHAR2(10) PRIMARY KEY,
xml_column XMLType);
CREATE DIRECTORY xmldir AS 'F:\OracleTestFiles\XMLs\';
the XML file:
<PurchaseOrder
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://localhost:8080/source/schemas/poSource/xsd/purchaseOrder.xsd">
<Reference>SBELL-2002100912333601PDT</Reference>
<Actions>
<Action>
<User>SVOLLMAN</User>
</Action>
</Actions>
<Reject/>
<Requestor>Sarah J. Bell</Requestor>
<User>SBELL</User>
<CostCenter>S30</CostCenter>
<ShippingInstructions>
<name>Sarah J. Bell</name>
<address>400 Oracle Parkway
Redwood Shores
CA
94065
USA</address>
<telephone>650 506 7400</telephone>
</ShippingInstructions>
<SpecialInstructions>Air Mail</SpecialInstructions>
<LineItems>
<LineItem ItemNumber="1">
<Description>A Night to Remember</Description>
<Part Id="715515009058" UnitPrice="39.95" Quantity="2"/>
</LineItem>
<LineItem ItemNumber="2">
<Description>The Unbearable Lightness Of Being</Description>
<Part Id="37429140222" UnitPrice="29.95" Quantity="2"/>
</LineItem>
<LineItem ItemNumber="3">
<Description>Sisters</Description>
<Part Id="715515011020" UnitPrice="29.95" Quantity="4"/>
</LineItem>
</LineItems>
</PurchaseOrder>
the insert statement:
INSERT INTO mytable1 VALUES ('1a', XMLType(bfilename('XMLDIR', 'PurchaseOrder.xml'), nls_charset_id('AL32UTF8')));
When I am executing the INSERT statement, I receive the following error:
Error report - ORA-22288: file or LOB operation FILEOPEN failed The
system cannot find the path specified. ORA-06512: at "SYS.XMLTYPE",
line 296 ORA-06512: at line 1
Can someone explain what is wrong, please?
Should I grant other privileges in the OS (Windows 7)?
I found the problem.
The phisically location of the directory from the hard drive was on a mapped driver (F:).
I changed it on C: and now it is working like a charm.

Read .csv table and print it as SQL query output

I am using a bastardised version of T-SQL to generate reports about information within a database driven CAD software (Solidworks Electrical). I am trying to generate a Table of Contents. Due to limitations within the software, I have to generate this table using SQL.
What I would like to do is create the Table of Contents in Excel, save it as a .csv, and have my SQL query read this file and spit it out as an output.
Example Table:
Sheet,System
1,Radios
2,Processors
3,Navigation
After some searching I've been unable to find a solution myself. My problems are:
1) Read a .csv file stored on my harddrive
2) Turn this .csv file into a table (cant get stored on the database, is just temporary while we run the query)
3) Output the data in this table as the results of the query
I have tried to use the following to read my .csv table, but recieve the error "Syntax error, permission violation, or other nonspecific error". So it's possible my software just won't allow me to read external files. (NB, my software uses ]] [[ instead of quotes....)
select
]]col1[[,
]]col2[[,
]]col3[[
from openrowset('MSDASQL'
,'Driver={Microsoft Access Text Driver (*.txt, *.csv)}'
,'select * from D:\SQL Queries\input.CSV')
Any assistance would be much appreciated! Thanks
This sql works for me:
select * from openrowset (bulk N'C:\Temp\source.csv', formatfile = N'C:\Temp\format.xml', firstrow=2) SourceFile
Content of source.csv is this:
Sheet,System
1,Radios
2,Processors
3,Navigation
Content of format.xml is this:
<?xml version="1.0"?>
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR=","/>
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="128" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="ID" xsi:type="SQLINT"/>
<COLUMN SOURCE="2" NAME="Name" xsi:type="SQLNVARCHAR"/>
</ROW>
</BCPFORMAT>

Liquibase changeset with only preConditions

I need to add changeSet with only preConditions tag and if it failed then stop execute. This is my changeset:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">
<changeSet id="GEO-6154_2" author="kadzhaev">
<preConditions onFail="HALT">
<sqlCheck expectedResult="0">select count(*) from "public"."messages" where key = 'branding.region.oktmo' and value != '';</sqlCheck>
</preConditions>
</changeSet>
</databaseChangeLog>
but it doesn't work cause:
liquibase: cvc-complex-type.2.4.a: Invalid content was found starting with element 'preConditions'. I think I should add some tag after preConditions but I do not need it. How to solve this problem?

Hue: oozie parameters

I want to pass 2 parameters to my Hiveql script in oozie,
my script:
ALTER TABLE default.otarie_appsession
ADD IF NOT EXISTS PARTITION ( insert_date=${dt},hr=${hr} );
My Oozie workflow :
When i send the job it ask for parameter values, so i put:
And this is the error:
2016-02-05 18:41:55,460 WARN org.apache.oozie.action.hadoop.HiveActionExecutor: SERVER[DVS1VM65] USER[root] GROUP[-] TOKEN[] APP[My_Workflow] JOB[0000290-160122145737153-oozie-oozi-W] ACTION[0000290-160122145737153-oozie-oozi-W#hive-a586] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [40000]
This is the XML of the workflow:
<workflow-app name="My_Workflow" xmlns="uri:oozie:workflow:0.5">
<start to="hive-a586"/>
<kill name="Kill">
<message>L'action a échoué, message d'erreur[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<action name="hive-a586">
<hive xmlns="uri:oozie:hive-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>/user/oozie/some_scripts/hive-site.xml</job-xml>
<script>/user/oozie/some_scripts/addpart.hql</script>
<param>hr=</param>
<param>dt=</param>
</hive>
<ok to="End"/>
<error to="Kill"/>
</action>
<end name="End"/>
</workflow-app>
When i remove all parmeters and use hard coded value, the script works fine, so its clear that i have problem to pass parameters. And my final goal is to pass current date and hour.
Thank you.
What about setting Hive parameters with Oozie parameters...
<param>hr=${bilouteHR}</param>
<param>dt=${bilouteDT}</param>
...then setting values for these Oozie parameters at submission time?
bilouteHR
00
bilouteDT
20160105
Hope that solves your issue, biloute.

dropwizard and liquibase: how to maintain ongoing database changes

I understand dropwizard expects all DB migrations to be in migrations.xml.
Let's say I'm starting a new project and create my tables:
<changeSet id="1" author="codahale">
<createTable tableName="people">
<column name="id" type="bigint" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="fullname" type="varchar(255)">
<constraints nullable="false"/>
</column>
<column name="jobtitle" type="varchar(255)"/>
</createTable>
</changeSet>
At the next iteration I have to add a new column so I ad another changeSet to migrations.xml:
<changeSet id="2" author="dbdemopostgres">
<addColumn tableName="people">
<column name="description" type="varchar(255)">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
Then let's say I have to make a column longer so I add:
<changeSet id="3" author="dbdemopostgres">
<modifyDataType tableName="people" columnName="description" newDataType="varchar(300)"/>
</changeSet>
And so it goes. I keep appending all changes to my migrations.xml which grows indefinitely. On a large project it's just a matter of time when it becomes unmanagable. Does anyone has any recommendations for strategy to maintain ongoing database changes?
You can divide your migrations.xml file to multiple files as documented here apparently.
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<include file="com/example/db/changelog/db.changelog-1.0.xml"/>
<include file="com/example/db/changelog/db.changelog-1.1.xml"/>
<include file="com/example/db/changelog/db.changelog-2.0.xml"/>
</databaseChangeLog>