batch-processing

Teradata: [Error 1154] [SQLState HY000] A failure occurred while inserting the batch of rows

不问归期 提交于 2019-12-13 02:35:38
问题 I have connected to my Teradata database via JDBC and am trying to use the FASTLOAD utility of Teradata to insert records into a table (with prepared statements and batch). Eg: connection = DriverManager.getConnection("jdbc:teradata://192.168.1.110/TYPE=FASTLOAD", "admin", "admin"); String sql = "INSERT INTO table (RANDOM_INTEGER) VALUES (?)"; PreparedStatement preparedStatement = connection.prepareStatement(sql); int numberOfRecordsToInsert = 100000; for (int i = 0; i <

Plot quadratic regression with equation displayed

 ̄綄美尐妖づ 提交于 2019-12-13 01:45:09
问题 I am trying to create a pdf page conatining 6 plots (3 rows and 2 columns) using a for loop. I am able to create the plots but i cant seem to automate adding a regression line to each plot. I am trying the following code. #Dummy data Data1 <- data.frame(flow = c(8,8.5,6,7.1,9), SP_elev = c(20,11,5,25,50)) Data2 <- data.frame(flow = c(7,7.2,6.5,8.2,8.5), SP_elev = c(13,15,18,25,19)) Data3 <- data.frame(flow = c(2,3,5,7,9), SP_elev = c(20,25,28,30,35)) Data4 <- data.frame(flow = c(1,4,6,8,9),

Superpose two sets of images

≡放荡痞女 提交于 2019-12-13 01:38:11
问题 I have two sets of images in folder A and folder B. They share common file names. E.g. I have Image01 and Image02 in both the folders. I need to superpose Image01 from folder A on Image 01 from folder B and so on respectively. Is there a way I can automate this using ImageMagick or batch processing? 回答1: Assuming your environment is Mac OSX or Linux or Unix... Then you could this: for img in A/* ; do \ convert \ A/${img} \ B/$(basename ${img}) \ -gravity center \ -compose blend \ -composite \

Spring Batch: How to access the current step's id / name from within an ItemReader or ItemWriter

我的未来我决定 提交于 2019-12-12 23:26:34
问题 I am quite new to Spring-Batch and I wonder whether there is a way to access the step-id from within an ItemReader or ItemWriter? In my case that would allow switching enum types based on different step-definitions in a single ItemReader implementation. Does anyone know a way to do that? 回答1: Assuming the ItemReader or ItemWriter are step scoped, you can do this: <bean id="flatFileItemReader" scope="step" class="org.springframework.batch.item.file.FlatFileItemReader"> <property name="resource

batch send “ENTER” key to running program

自作多情 提交于 2019-12-12 17:40:58
问题 I have an "old-good" fortran.exe file (without access to the code) and I need to execute a few hundred times using a batch file. However, at the end of the fortran program, it prints "Press ENTER to exit" , interrupting, of course, the execution of the batch file... Is there a way to send the {ENTER} to the running program? 回答1: check the sendkeys.bat. The script is capable to send a keys to running program with particular title: call sendkeys.bat "fortran-program" "{ENTER}" EDIT try with

Spring Batch - late binding of commit interval not working with skip policy

倖福魔咒の 提交于 2019-12-12 16:20:28
问题 I'm trying to use the late binding on the commit-interval attribute of a chunk. When the chunk doesn't contain a skip-policy or retry-policy, it works fine but as soon as a skip-policy is added (or even a retry-policy), the commit-interval is not taken into account and the batch works as if the commit-interval is set to 1. The weird thing is, when the commit-interval is hard coded, it works fine... So this configuration works fine : <chunk reader="multiAccuseReceptionItemReader" processor=

Batch Command Conflict

怎甘沉沦 提交于 2019-12-12 15:34:59
问题 I have made this batch script which will allow the user to enter a website's URL as well as a time in minutes, it then adds the URL to the hosts file and removes it once the time expires. (Effectively blocking a website for a certain amount of time) It removes the website from the hosts file by creating another batch file when it is first run, and then uses the AT command to launch the new batch file at the specified time. It works when blocking multiple websites, the only problem is if more

Executing several SQL queries with MySQLdb

末鹿安然 提交于 2019-12-12 12:52:21
问题 How would you go about executing several SQL statements (script mode) with python? Trying to do something like this: import MySQLdb mysql = MySQLdb.connect(host='host...rds.amazonaws.com', db='dbName', user='userName', passwd='password') sql = """ insert into rollout.version (`key`, `value`) VALUES ('maxim0', 'was here0'); insert into rollout.version (`key`, `value`) VALUES ('maxim1', 'was here1'); insert into rollout.version (`key`, `value`) VALUES ('maxim2', 'was here1'); """ mysql.query

Mule batch commit and records failures

霸气de小男生 提交于 2019-12-12 10:55:27
问题 My current scenario: I have 10000 records as input to batch . As per my understanding, batch is only for record-by-record processing.Hence, i am transforming each record using dataweave component inside batch step(Note: I havenot used any batch-commit) and writing each record to file. The reason for doing record-by-record processing is suppose in any particular record, there is an invalid data, only that particular record gets failed, rest of them will be processed fine. But in many of the

Java Batch job in cluster environment

我的未来我决定 提交于 2019-12-12 10:50:01
问题 We have a cluster with 2 JBOSS nodes. We have a batch job which loads all users details from a active directory to a DB. This job is run everyday. It was run before in a non clustered environment and hence we designed it as a singleton. Now we have a clustered environment and I do not know what is best way to achieve the same result. I want batch job to be run only once a day. We use spring and hibernate and I looked at Spring batch. I could not get any concise answer to my question. Can