From mwlang at mdlogix.com Mon Feb 4 08:02:10 2008 From: mwlang at mdlogix.com (Michael Lang) Date: Mon, 04 Feb 2008 08:02:10 -0500 Subject: [Activewarehouse-discuss] Is the demo or online article up-to-date? In-Reply-To: <57f29e620802021920v6ee0ce08j2ff3e82cc86f8608@mail.gmail.com> References: <47A11FA6.6010601@mdlogix.com> <57f29e620802021920v6ee0ce08j2ff3e82cc86f8608@mail.gmail.com> Message-ID: <47A70CD2.5050609@mdlogix.com> Marty, Thanks for responding. Perhaps, in light of you and Anthony being hog-tied, I can simply install that last known active warehouse gem and sample project's revision as they were back when the article was written (or before the major refactor effort you're currently doing)? I am more than willing to help as I believe this suite has a lot to offer for the initiatives I'm beginning to undertake at my company. Regards, Michael Marty Haught wrote: > Michael, > > I personally haven't followed the tutorial recently but I'm in the > middle of doing some serious refactoring on the view components of > ActiveWarehouse and will most likely need to redo a tutorial once I > get there. Sadly, I probably won't get all this done for another > couple weeks. Hopefully Anthony will have some time to respond. I > know he just switched jobs and has been super busy in the last two > weeks. > > Cheers, > Marty > > On Jan 30, 2008 6:08 PM, Michael Lang wrote: > >> I am trying to run the demo by following this article: >> >> http://anthonyeden.com/2006/12/20/activewarehouse-example-with-rails-svn-logs >> >> I cheated like an impatient reader jumping to last page of a mystery >> novel and pulled down the code: >> >> |svn checkout >> svn://rubyforge.org/var/svn/activewarehouse/rails_warehouse/trunk >> >> I then pulled down the rails logs with: >> >> ~/rails_warehouse/db/etl/download_rails_log.rb >> >> (since the download_aw_log.rb resulted in an empty input/aw_log.xml file) >> >> I then changed the *.ctl files to reflect input/rails_log.xml and >> successfully loaded the data into the tables, so I'm pretty sure I have >> that much working fine. >> >> However, I noticed a couple issues with the app itself... >> >> The checked out code differs from the article in that the Revisions >> Controller has an empty index and a by_author function that has same >> code as the index def whereas the article just has the index method. >> >> There are no rake warehouse:xxxx tasks. "rake -T | grep warehouse" >> returns an empty set. >> >> When I follow the article, generating new controllers, views, models, >> and run the code, I get for http://localhost:3000/revision_reports the >> following: >> >> NameError in Revision reportsController#index >> >> uninitialized constant RevisionReportsController::ActiveWarehouse >> >> RAILS_ROOT: script/../config/.. >> Application Trace | Framework Trace | Full Trace >> >> /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:477:in >> `const_missing' >> app/controllers/revision_reports_controller.rb:4:in `index' >> >> >> I have the following (subset) of gems installed: >> >> activewarehouse (0.3.0) >> activewarehouse-etl (0.9.0) >> adapter_extensions (0.4.0) >> mongrel (1.0.1) >> rails (1.2.3, 1.1.6) >> rails_sql_views (0.6.1) >> >> ...and am running the following Ruby version: >> ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1] >> >> (on a Macbook Pro, Tiger) >> >> Any ideas what might be the problem? >> >> Regards, >> >> Michael >> | >> _______________________________________________ >> Activewarehouse-discuss mailing list >> Activewarehouse-discuss at rubyforge.org >> http://rubyforge.org/mailman/listinfo/activewarehouse-discuss >> >> > > From mghaught at gmail.com Mon Feb 4 23:00:02 2008 From: mghaught at gmail.com (Marty Haught) Date: Mon, 4 Feb 2008 21:00:02 -0700 Subject: [Activewarehouse-discuss] New render code in trunk Message-ID: <57f29e620802042000n4f6788d5l7e945c145aa8fec2@mail.gmail.com> Hey Everyone, I did a fairly large check-in today into ActiveWarehouse trunk with the new render code that I've been working on. If you're running on the latest trunk you will need to change how your views render the code. I've drafted up a quick post on my blog with some of the changes: http://martyhaught.com/articles/2008/02/04/latest-activewarehouse-changes/ I will do a more detailed post about these options in the near future. If you have any questions please ask away. Cheers, Marty Haught From mwlang at mdlogix.com Tue Feb 5 13:34:35 2008 From: mwlang at mdlogix.com (Michael Lang) Date: Tue, 05 Feb 2008 13:34:35 -0500 Subject: [Activewarehouse-discuss] Is the demo or online article up-to-date? In-Reply-To: <57f29e620802021920v6ee0ce08j2ff3e82cc86f8608@mail.gmail.com> References: <47A11FA6.6010601@mdlogix.com> <57f29e620802021920v6ee0ce08j2ff3e82cc86f8608@mail.gmail.com> Message-ID: <47A8AC3B.7060306@mdlogix.com> I was able to get the tutorial running yesterday and also adapt the code to Marty's new changes today. I've gotten far used to installing gems and then having them available from the Rails application. The trick to getting it running came from the online tutorial: script/plugin install svn://rubyforge.org/var/svn/activewarehouse/activewarehouse/trunk Once I did this, I had the cubes up and drilling down. About your refactorings, will this make it easy to expose to the user a way to change the drilldown paths? For example, instead of year --> quarter --> months, be able to run year --> months Michael Marty Haught wrote: > Michael, > > I personally haven't followed the tutorial recently but I'm in the > middle of doing some serious refactoring on the view components of > ActiveWarehouse and will most likely need to redo a tutorial once I > get there. Sadly, I probably won't get all this done for another > couple weeks. Hopefully Anthony will have some time to respond. I > know he just switched jobs and has been super busy in the last two > weeks. > > Cheers, > Marty > > On Jan 30, 2008 6:08 PM, Michael Lang wrote: > >> I am trying to run the demo by following this article: >> >> http://anthonyeden.com/2006/12/20/activewarehouse-example-with-rails-svn-logs >> >> I cheated like an impatient reader jumping to last page of a mystery >> novel and pulled down the code: >> >> |svn checkout >> svn://rubyforge.org/var/svn/activewarehouse/rails_warehouse/trunk >> >> I then pulled down the rails logs with: >> >> ~/rails_warehouse/db/etl/download_rails_log.rb >> >> (since the download_aw_log.rb resulted in an empty input/aw_log.xml file) >> >> I then changed the *.ctl files to reflect input/rails_log.xml and >> successfully loaded the data into the tables, so I'm pretty sure I have >> that much working fine. >> >> However, I noticed a couple issues with the app itself... >> >> The checked out code differs from the article in that the Revisions >> Controller has an empty index and a by_author function that has same >> code as the index def whereas the article just has the index method. >> >> There are no rake warehouse:xxxx tasks. "rake -T | grep warehouse" >> returns an empty set. >> >> When I follow the article, generating new controllers, views, models, >> and run the code, I get for http://localhost:3000/revision_reports the >> following: >> >> NameError in Revision reportsController#index >> >> uninitialized constant RevisionReportsController::ActiveWarehouse >> >> RAILS_ROOT: script/../config/.. >> Application Trace | Framework Trace | Full Trace >> >> /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:477:in >> `const_missing' >> app/controllers/revision_reports_controller.rb:4:in `index' >> >> >> I have the following (subset) of gems installed: >> >> activewarehouse (0.3.0) >> activewarehouse-etl (0.9.0) >> adapter_extensions (0.4.0) >> mongrel (1.0.1) >> rails (1.2.3, 1.1.6) >> rails_sql_views (0.6.1) >> >> ...and am running the following Ruby version: >> ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1] >> >> (on a Macbook Pro, Tiger) >> >> Any ideas what might be the problem? >> >> Regards, >> >> Michael >> | >> _______________________________________________ >> Activewarehouse-discuss mailing list >> Activewarehouse-discuss at rubyforge.org >> http://rubyforge.org/mailman/listinfo/activewarehouse-discuss >> >> > > From phylae at gmail.com Tue Feb 5 22:59:19 2008 From: phylae at gmail.com (Paul Cortens) Date: Tue, 5 Feb 2008 19:59:19 -0800 Subject: [Activewarehouse-discuss] A very long message about the architecture of ActiveWarehouse Message-ID: <00af01c86874$a70951c0$f51bf540$@com> Hi, I have recently started a project using ActiveWarehouse and ActiveWarehouse ETL. When I chose these tools I knew they were very early in their implementation; however, I wanted the flexibility that ruby offers so I decided that using a "new" technology was worth it. Now that I have completed a prototype of my project, I have a lot of questions about the architecture of both ActiveWarehouse and ActiveWarehouse ETL. I have been thinking quite a lot about how I would design such tools. I am curious if my ideas have been considered already, and if so why the current implementation was chosen. If my ideas have not been considered before, then I would like to hear some feedback from the community before I start implementing them. Before I get into the (lengthy) list of ideas I have, I should give you some background on where these ideas are coming from. I have been working at a foreign exchange company since I finished my commerce degree 2 years ago. Most of my time there has been spent leading the development of their (small) data warehouse. That DW is entirely built on Microsoft products. Until I started using ActiveWarehouse, the Microsoft tools were my only in-depth exposure to ETL tools. In case you haven't used SSIS and SSAS, those products have many great selling features; however there are many fatal flaws that contradict all the best practices that the rails community encourages. DRY, good version control, and even the most basic testing are all nearly impossible to do well with SSIS. On top of this, very few SSIS developers seem to care!!! (I know some do.) I want to be involved with a development community that encourages best practices, so I am trying to avoid Microsoft's DW tools. This (combined with what I said before about the flexibility of ruby) brings me to ActiveWarehouse-ActiveWarehouse ETL specifically. So here are my 'ideas' for how the ideal ETL tool should be designed. Please keep in mind that these are just ideas, not recommendations. I would really like to generate some good debate. Then, if we can agree on something I will start working on an implementation. How does an ETL process (or a Data Warehouse in general) fit into the MVC pattern? Dimensions and Facts are obviously models. But what about the ctl file that fills in a dimension table using a csv and a few transforms? It looks like a controller to me, but maybe it is just a really complex constructor method for a model (i.e. def MyDimension.new(csv); insert complex code; end). What are the arguments against fitting a DW into the MVC pattern? Environments. I LOVE the different environments in rails. I especially love how I don't have to think about them. They just work. Any ideas on how this should/could be implemented? Testing. This fits right in with environments. I have had several headaches from trying to test my ETL processes. I have also recently fallen in love with RSpec. It should be really easy to stub/mock the various parts of the ETL code: in, out, sk lookups, etc. How do you test your code? Readability. Any thoughts on how to make the ETL code more readable? I know it is fairly readable know, but it isn't as readable as ruby/rails code can be. SK Lookups. These should be class methods of the dimension model (think specialized finders). The id of the dimension is the surrogate key. This (as well as the business key) are stored in the dimension table. Therefore, the dimension model should handle this logic, right? Maybe we can get an sk_lookup method in the ActiveWarehouse::Dimension class. Then we could do this in our ETL: MyDimension.sk_lookup(bk) to get the sk. Or we could do MyDimension.sk_lookup(bk, effective_date) for SCDs. SCDs. This is another place where the main logic should be in the model. I want to be able to hand the data to my dimension and it will insert and/or update the table accordingly. The ETL process can handle getting the data into the dimensional format because it may come from many different places, but SCD handling will be the same for all data sources and can be handled by the model. Convention Over Configuration. I think there is a ton of room for time-saving conventions, especially with regards to SCDs. start_date, end_date, and enabled columns should be used to track the effective dates and which is the current row. I would argue that these columns should be created automatically (like id). bk - there should be a convention for naming the business key. I think the column should be required-though the data type may vary, I can't think of a dimension that doesn't have a business key. All columns (except id, bk, start_date, end_date, and enabled) are assumed to be type 1 SCDs. This could be overridden by something like `default_scd :historic`. However, columns prefixed by -'current_' => type 1 - the current value -'first_' => never change - the first value -'historic_' => type 2 - the value valid between the start and end dates -'previous_' => the value valid just before the current value -'current_minus_number_' => the value valid 'number' before the current value -'first_plus_number_' => the value valid 'number' after the first value The validate method of the dimension model should ensure that a particular record does not violate the SCD rules (i.e. no overlapping start_dates/end_dates, etc.) There should also be some support for source systems that already have some form of history tracking (like acts_as_versioned). Ok, so those are my thoughts. Please remember, when I say 'should', I don't mean that ActiveWarehouse ETL must be done this way. These are all ideas that have come to me over the past while in working on data warehousing. I think they might have some merit, but I want to discuss them with the community before I start flushing them out and working on any of them. I am really excited about helping to develop ActiveWarehouse. I look forward to your comments (both positive and negative) Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080205/e9b6c0da/attachment.html From anthonyeden at gmail.com Tue Feb 5 23:11:57 2008 From: anthonyeden at gmail.com (Anthony Eden) Date: Tue, 5 Feb 2008 20:11:57 -0800 Subject: [Activewarehouse-discuss] A very long message about the architecture of ActiveWarehouse In-Reply-To: <00af01c86874$a70951c0$f51bf540$@com> References: <00af01c86874$a70951c0$f51bf540$@com> Message-ID: Paul, Thanks for the deep comments on this type of stuff. I wanted to let you know that I do plan on responding, however at the moment I am extremely busy, so please be patient and I will provide my input soon. V/r Anthony Eden On Feb 5, 2008 7:59 PM, Paul Cortens wrote: > > > > > Hi, > > > > I have recently started a project using ActiveWarehouse and ActiveWarehouse > ETL. When I chose these tools I knew they were very early in their > implementation; however, I wanted the flexibility that ruby offers so I > decided that using a "new" technology was worth it. > > > > Now that I have completed a prototype of my project, I have a lot of > questions about the architecture of both ActiveWarehouse and ActiveWarehouse > ETL. I have been thinking quite a lot about how I would design such tools. I > am curious if my ideas have been considered already, and if so why the > current implementation was chosen. If my ideas have not been considered > before, then I would like to hear some feedback from the community before I > start implementing them. > > > > Before I get into the (lengthy) list of ideas I have, I should give you some > background on where these ideas are coming from. > > > > I have been working at a foreign exchange company since I finished my > commerce degree 2 years ago. Most of my time there has been spent leading > the development of their (small) data warehouse. That DW is entirely built > on Microsoft products. Until I started using ActiveWarehouse, the Microsoft > tools were my only in-depth exposure to ETL tools. In case you haven't used > SSIS and SSAS, those products have many great selling features; however > there are many fatal flaws that contradict all the best practices that the > rails community encourages. DRY, good version control, and even the most > basic testing are all nearly impossible to do well with SSIS. On top of > this, very few SSIS developers seem to care!!! (I know some do.) > > > > I want to be involved with a development community that encourages best > practices, so I am trying to avoid Microsoft's DW tools. This (combined with > what I said before about the flexibility of ruby) brings me to > ActiveWarehouse?ActiveWarehouse ETL specifically. > > > > So here are my 'ideas' for how the ideal ETL tool should be designed. Please > keep in mind that these are just ideas, not recommendations. I would really > like to generate some good debate. Then, if we can agree on something I will > start working on an implementation. > > > > > > How does an ETL process (or a Data Warehouse in general) fit into the MVC > pattern? Dimensions and Facts are obviously models. But what about the ctl > file that fills in a dimension table using a csv and a few transforms? It > looks like a controller to me, but maybe it is just a really complex > constructor method for a model (i.e. def MyDimension.new(csv); insert > complex code; end). What are the arguments against fitting a DW into the MVC > pattern? > > > > > > Environments. I LOVE the different environments in rails. I especially love > how I don't have to think about them. They just work. Any ideas on how this > should/could be implemented? > > > > > > Testing? This fits right in with environments. I have had several headaches > from trying to test my ETL processes. I have also recently fallen in love > with RSpec. It should be really easy to stub/mock the various parts of the > ETL code: in, out, sk lookups, etc. How do you test your code? > > > > > > Readability. Any thoughts on how to make the ETL code more readable? I know > it is fairly readable know, but it isn't as readable as ruby/rails code can > be. > > > > > > SK Lookups. These should be class methods of the dimension model (think > specialized finders). The id of the dimension is the surrogate key. This (as > well as the business key) are stored in the dimension table. Therefore, the > dimension model should handle this logic, right? Maybe we can get an > sk_lookup method in the ActiveWarehouse::Dimension class. Then we could do > this in our ETL: MyDimension.sk_lookup(bk) to get the sk. Or we could do > MyDimension.sk_lookup(bk, effective_date) for SCDs. > > > > SCDs. This is another place where the main logic should be in the model. I > want to be able to hand the data to my dimension and it will insert and/or > update the table accordingly. The ETL process can handle getting the data > into the dimensional format because it may come from many different places, > but SCD handling will be the same for all data sources and can be handled by > the model. > > > > Convention Over Configuration. I think there is a ton of room for > time-saving conventions, especially with regards to SCDs. > > > > start_date, end_date, and enabled columns should be used to track the > effective dates and which is the current row. I would argue that these > columns should be created automatically (like id). > > bk ? there should be a convention for naming the business key. I think the > column should be required?though the data type may vary, I can't think of a > dimension that doesn't have a business key. > > All columns (except id, bk, start_date, end_date, and enabled) are assumed > to be type 1 SCDs. This could be overridden by something like `default_scd > :historic`. > > However, columns prefixed by > > -'current_' => type 1 - the current value > > -'first_' => never change - the first value > > -'historic_' => type 2 - the value valid between the start and end dates > > -'previous_' => the value valid just before the current value > > -'current_minus_number_' => the value valid 'number' before the current > value > > -'first_plus_number_' => the value valid 'number' after the first value > > > > The validate method of the dimension model should ensure that a particular > record does not violate the SCD rules (i.e. no overlapping > start_dates/end_dates, etc.) > > > > There should also be some support for source systems that already have some > form of history tracking (like acts_as_versioned). > > > > > > > > Ok, so those are my thoughts. Please remember, when I say 'should', I don't > mean that ActiveWarehouse ETL must be done this way. These are all ideas > that have come to me over the past while in working on data warehousing. I > think they might have some merit, but I want to discuss them with the > community before I start flushing them out and working on any of them. > > > > I am really excited about helping to develop ActiveWarehouse. I look forward > to your comments (both positive and negative) > > > > Paul > > > > > > > > > _______________________________________________ > Activewarehouse-discuss mailing list > Activewarehouse-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > > From mghaught at gmail.com Wed Feb 6 11:12:01 2008 From: mghaught at gmail.com (Marty Haught) Date: Wed, 6 Feb 2008 09:12:01 -0700 Subject: [Activewarehouse-discuss] Is the demo or online article up-to-date? In-Reply-To: <47A8AC3B.7060306@mdlogix.com> References: <47A11FA6.6010601@mdlogix.com> <57f29e620802021920v6ee0ce08j2ff3e82cc86f8608@mail.gmail.com> <47A8AC3B.7060306@mdlogix.com> Message-ID: <57f29e620802060812h79de790eh57213ba46b95283f@mail.gmail.com> > About your refactorings, will this make it easy to expose to the user a > way to change the drilldown paths? > > For example, instead of year --> quarter --> months, be able to run year > --> months Sort of. The first solution would be to create a new hierarchy in your date dimension that drops the quarter from the hierarchy. Here's a short example where the partial_date hierarchy that only exposes a year and month. class MyDateDimension < ActiveWarehouse::Dimension define_hierarchy :full_date, [:year, :quarter, :month, :date] define_hierarchy :partial_date, [:year, :month] end However, if you need to still have all levels of the hierarchy but want the breadcrumb to behave differently then you can make your own render code that mimics the breadcrumb method with your custom logic. We did a lot of our own render methods while we refactored the view code until we settled on a final design. Matter of fact, we still have some custom render methods that we haven't finalized but will eventually get those back into the plugin. Hope that helps. Cheers, Marty From jesperrr at gmail.com Wed Feb 13 14:31:02 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Wed, 13 Feb 2008 20:31:02 +0100 Subject: [Activewarehouse-discuss] Documentation update Message-ID: Hi there As a newcomer to ActiveWarehouse-ETL, i feel that the documentation could be better. Here are some things that i believe would make me learn aw-ETL faster. And also things there I wasted some hours before understanding what was going on. The examples in http://activewarehouse.rubyforge.org/docs/activewarehouse-etl.html are in general good. * they should be backported into the rdoc http://activewarehouse.rubyforge.org/etl/rdoc/ * there could be more examples and complete overview of what options/mappings are accepted where There seems to be inconsistencies in how options are called and their names for sources and destinations. This makes it harder to learn. An example of inconsistency is ETL::Control::FileDestination takes :separator but the ETL::Control::FileSource takes :options=>{:col_sep=>";"} Why are these not the same? (i realize that not all of these can be eas?ily solved but the most obvious ones should be aliased which would add consistency and be a non breaking change ) Also, the naming :in, :file => '' is somewhat magically mapped to FileSource control . This should be more explicit mentioned in the RDoc. Furthermore, the flow through the code is not explained. like Also I would like to have explanations and links to a few common .ctl and .etb files. Which rules can be used and is there a special order the rules have to be in. What about the :before_write directive, just to name one. Is that a rule that can be used inside an :in, :out or both directives? Or is it it's "own"? Much of this stuff really confuses me-- but now after having spent 2 days, i feel that the documentation could have helped me more. So i figure i would help the documentation! I'd love to give a helping hand here by adding some of the stuff, and i am asking if some of you would like to do the same :) Please write me or IM me on my gmail account (jesperrr), i plan to use this evening and some of tomorrow on this. Any help and suggesions appreciated. /Jesper PS. i am crossposting this on activewarehouse-discuss at rubyforge.org and rubyonrails-talk google group. -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ ___________________________________________________________ From jesperrr at gmail.com Wed Feb 13 14:45:53 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Wed, 13 Feb 2008 20:45:53 +0100 Subject: [Activewarehouse-discuss] Documentation update In-Reply-To: References: Message-ID: > PS. i am crossposting this on activewarehouse-discuss at rubyforge.org > and rubyonrails-talk google group. What am i thinking... i am crossposting at ruby-talk mailing list.. Not that many activewarehouse-etl related posts on the rubyonrails list ... -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ ___________________________________________________________ From jesperrr at gmail.com Wed Feb 13 18:06:40 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Thu, 14 Feb 2008 00:06:40 +0100 Subject: [Activewarehouse-discuss] Documentation update In-Reply-To: References: Message-ID: Here is my first patch. Tell me if you like it and also if you feel motivated to help out? (i have mostly copy-pasted from the user guide ... that's a good start to get better rdoc) To apply patch put in /activewarehouse/etl/trunk/ -------------- next part -------------- A non-text attachment was scrubbed... Name: documentation_patch_01.patch Type: application/octet-stream Size: 19741 bytes Desc: not available Url : http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080214/b96a1c9f/attachment-0001.obj From jesperrr at gmail.com Thu Feb 14 08:14:30 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Thu, 14 Feb 2008 14:14:30 +0100 Subject: [Activewarehouse-discuss] Documentation update In-Reply-To: References: Message-ID: One more documentation patch. I have added more notes.from the article. Furthermore, to convert the
to , i made this script (posted here for future reference) $ cd activewarehouse/etl/trunk $ find ./lib | egrep ".rb$"| xargs sed -r -e "s/<(\/?)div/<$1tt/g" -i /Jesper PS i hope you find the rdoc additions helpful and i also hope that you will review it to make sure it is described the way the code works :) -------------- next part -------------- A non-text attachment was scrubbed... Name: documentation_patch_03.patch Type: application/octet-stream Size: 28928 bytes Desc: not available Url : http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080214/71f5f3d0/attachment-0001.obj From jesperrr at gmail.com Thu Feb 14 09:45:02 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Thu, 14 Feb 2008 15:45:02 +0100 Subject: [Activewarehouse-discuss] activewarehouse-etl how to increase log level Message-ID: How do i set log level in a .ctl file? what are my options for setting it there? I looked briefly at ETL::Engine and i think it's hardcoded here? But I may be wrong? /Jesper -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ ___________________________________________________________ From jesperrr at gmail.com Fri Feb 15 18:25:22 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Sat, 16 Feb 2008 00:25:22 +0100 Subject: [Activewarehouse-discuss] Activewarehouse-ETL userguide update Message-ID: Tiny update for the Activewarehouse-ETL userguide. -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ jesperrr at gmail.com (Private e-mail and Google Talk IM) ___________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080216/e9816b75/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: userguide-etl-patch.patch Type: application/octet-stream Size: 2478 bytes Desc: not available Url : http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080216/e9816b75/attachment.obj From jesperrr at gmail.com Fri Feb 15 18:33:41 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Sat, 16 Feb 2008 00:33:41 +0100 Subject: [Activewarehouse-discuss] rails_warehouse demo project and Rails 2.0 errors Message-ID: On my Windows XP machine, the rails_warehouse demo project would not start up. In order to update scripts, I used these steps: 1) added Rails edge to /vendor/rails (rake rails:freeze:edge) 2) ran rake rails:scripts:update This updated /config/boot.rb to the following (see below the signature). I also added /config/initializers/inflections.rb /config/initializers/mime_types.rb /script/performance/request PS. I'm attaching as a patch to this mail -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ jesperrr at gmail.com (Private e-mail and Google Talk IM) ___________________________________________________________ # Don't change this file! # Configure your app in config/environment.rb and config/environments/*.rb RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) module Rails class << self def boot! unless booted? preinitialize pick_boot.run end end def booted? defined? Rails::Initializer end def pick_boot (vendor_rails? ? VendorBoot : GemBoot).new end def vendor_rails? File.exist?("#{RAILS_ROOT}/vendor/rails") end # FIXME : Ruby 1.9 def preinitialize load(preinitializer_path) if File.exists?(preinitializer_path) end def preinitializer_path "#{RAILS_ROOT}/config/preinitializer.rb" end end class Boot def run load_initializer Rails::Initializer.run(:set_load_path) end end class VendorBoot < Boot def load_initializer require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" end end class GemBoot < Boot def load_initializer self.class.load_rubygems load_rails_gem require 'initializer' end def load_rails_gem if version = self.class.gem_version gem 'rails', version else gem 'rails' end rescue Gem::LoadError => load_error $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) exit 1 end class << self def rubygems_version Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion end def gem_version if defined? RAILS_GEM_VERSION RAILS_GEM_VERSION elsif ENV.include?('RAILS_GEM_VERSION') ENV['RAILS_GEM_VERSION'] else parse_gem_version(read_environment_rb) end end def load_rubygems require 'rubygems' unless rubygems_version >= '0.9.4' $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.) exit 1 end rescue LoadError $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org) exit 1 end def parse_gem_version(text) $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ end private def read_environment_rb File.read("#{RAILS_ROOT}/config/environment.rb") end end end end # All that for this: Rails.boot! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080216/7e31ea4d/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rails_warehouse_rails2.0.patch Type: application/octet-stream Size: 7078 bytes Desc: not available Url : http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080216/7e31ea4d/attachment-0001.obj From jesperrr at gmail.com Fri Feb 15 18:52:22 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Sat, 16 Feb 2008 00:52:22 +0100 Subject: [Activewarehouse-discuss] problems using bulk_import (to mysql on win xp) Message-ID: Hi there I have been trying for days to get bulk import working with Activewarehouse-ETL Here is my rule in employees.ctl: post_process :bulk_import, { :file => 'output/employees.out.txt', :columns => EMPLOYEE_COLS, :truncate => true, :field_separator => ',', :field_enclosure => '"', #:line_separator => '\n', :ignore => 1, :target => :development, :table => 'employees' } ====This is the error I get when running:==== > C:\Documents and Settings\Administrator\My > Documents\rails\ourpeople\import>etl -c ../config/database.yml --limit 200 > employees.ctl > Using AdapterExtensions > Starting ETL process > initializing ETL engine > Processing employees.ctl > Source: employees.csv > Limiting enabled: 200 > Reached limit of 200 > > Executing screens > Screens passed > > Executing post processes > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in > `log': Mysql::Error: #42000The used command is not allowed with this MySQL > version: LOAD DATA LOCAL INFILE 'C:/Documents and Settings/Administrator/My > Documents/rails/ourpeople/import/output/employees.out.txt' INTO TABLE > employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES > (id,cgid,longid,firstname,lastname,displayname,middleinitial,initials,phone,mobile,fax,subcellphone,email,englishtitle,localtitle,secretary_id,mentor_id,substitute_id,manager_id,comment,licenseplate,employment_cgemployee,employment_cgexternal,employment_cgtemporary,employeework_employeeid,employeework_workpercentage,employeework_actualworkpercentage,company_id,grade_id,location_id,organisation_id,profession_id,resourcetype_id,skillsunit_id,staffingunit_id) > (ActiveRecord::StatementInvalid) > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in > `execute' > from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/mysql_adapter.rb:46:in > `do_bulk_load' > from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/abstract_adapter.rb:18:in > `bulk_load' > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:73:in > `process' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in > `transaction' > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:62:in > `process' > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:485:in > `post_process' > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:484:in > `each' > ... 13 levels... > from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in > `require' > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0 > /bin/etl:28 > from c:/ruby/bin/etl:19:in `load' > from c:/ruby/bin/etl:19 > ====end of error==== I have tried a lot of different combinations of flags in that bulk_import directive. Am i getting it right? Could you please show me some working examples. Also, for adapter_extensions there seems to be a patch adding this line to the mysql adapter > --- activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > (revision 8484) > +++ activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > (working copy) > @@ -467,6 +467,7 @@ > if encoding > @connection.options(Mysql::SET_CHARSET_NAME, encoding) rescue > nil > end > + @connection.options(Mysql::OPT_LOCAL_INFILE, true) > @connection.ssl_set(@config[:sslkey], @config[:sslcert], > @config[:sslca], @config[:sslcapath], @config[:sslcipher]) if > @config[:sslkey] > @connection.real_connect(*@connection_options) > execute("SET NAMES '#{encoding}'") if encoding > Well, i did not apply the patch to version 0.4.0 because it seemed like it was already in the code (however, not "true" but "1" at the end of the line) The most odd thing is that I can easily run a bulk import via the local sql command: > /ourpeople/import/> > $ mysql ourpeople_development < import.sql --user=root -p > Where the import.sql contains > LOAD DATA LOCAL INFILE './output/employees.out.txt' INTO TABLE > employees CHARACTER SET latin1 FIELDS TERMINATED BY ',' IGNORE 1 LINES > ; Any suggestions/ideas to what i might be doing wrong? Any examples of working code you can share? -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ jesperrr at gmail.com (Private e-mail and Google Talk IM) ___________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080216/c9dcc378/attachment.html From mghaught at gmail.com Fri Feb 15 18:58:58 2008 From: mghaught at gmail.com (Marty Haught) Date: Fri, 15 Feb 2008 16:58:58 -0700 Subject: [Activewarehouse-discuss] problems using bulk_import (to mysql on win xp) In-Reply-To: References: Message-ID: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> Hi Jesper, My understanding is that this is an issue with how ActiveRecord works with MySQL. I believe there was a change in how MySQL did bulk update and that ActiveRecord's way of calling this no longer works. Sorry, I don't have more technical information on the issue. Our work around has been to turn off bulk uploads. Maybe someone else who has more detailed information on this can speak up. Cheers, Marty On Fri, Feb 15, 2008 at 4:52 PM, Jesper R?nn-Jensen wrote: > Hi there > I have been trying for days to get bulk import working with > Activewarehouse-ETL > Here is my rule in employees.ctl: > > post_process :bulk_import, { > :file => 'output/employees.out.txt', > :columns => EMPLOYEE_COLS, > :truncate => true, > :field_separator => ',', > :field_enclosure => '"', > #:line_separator => '\n', > :ignore => 1, > :target => :development, > :table => 'employees' > } > > ====This is the error I get when running:==== > > C:\Documents and Settings\Administrator\My > Documents\rails\ourpeople\import>etl -c ../config/database.yml --limit 200 > employees.ctl > > Using AdapterExtensions > > Starting ETL process > > initializing ETL engine > > Processing employees.ctl > > Source: employees.csv > > Limiting enabled: 200 > > Reached limit of 200 > > > > Executing screens > > Screens passed > > > > Executing post processes > > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in > `log': Mysql::Error: #42000The used command is not allowed with this MySQL > version: LOAD DATA LOCAL INFILE 'C:/Documents and Settings/Administrator/My > Documents/rails/ourpeople/import/output/employees.out.txt' INTO TABLE > employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES > (id,cgid,longid,firstname,lastname,displayname,middleinitial,initials,phone,mobile,fax,subcellphone,email,englishtitle,localtitle,secretary_id,mentor_id,substitute_id,manager_id,comment,licenseplate,employment_cgemployee,employment_cgexternal,employment_cgtemporary,employeework_employeeid,employeework_workpercentage,employeework_actualworkpercentage,company_id,grade_id,location_id,organisation_id,profession_id,resourcetype_id,skillsunit_id,staffingunit_id) > (ActiveRecord::StatementInvalid) > > from > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in > `execute' > > from > c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/mysql_adapter.rb:46:in > `do_bulk_load' > > from > c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/abstract_adapter.rb:18:in > `bulk_load' > > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:73:in > `process' > > from > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in > `transaction' > > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:62:in > `process' > > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:485:in > `post_process' > > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:484:in > `each' > > ... 13 levels... > > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in > `require' > > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/etl:28 > > from c:/ruby/bin/etl:19:in `load' > > from c:/ruby/bin/etl:19 > > > ====end of error==== > > I have tried a lot of different combinations of flags in that bulk_import > directive. Am i getting it right? Could you please show me some working > examples. > > Also, for adapter_extensions there seems to be a patch adding this line to > the mysql adapter > > > > --- activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > (revision 8484) > > +++ activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > (working copy) > > @@ -467,6 +467,7 @@ > > if encoding > > @connection.options(Mysql::SET_CHARSET_NAME, encoding) rescue > nil > > end > > + @connection.options(Mysql::OPT_LOCAL_INFILE, true) > > @connection.ssl_set(@config[:sslkey], @config[:sslcert], > @config[:sslca], @config[:sslcapath], @config[:sslcipher]) if > @config[:sslkey] > > @connection.real_connect(*@connection_options) > > execute("SET NAMES '#{encoding}'") if encoding > > > > > Well, i did not apply the patch to version 0.4.0 because it seemed like it > was already in the code (however, not "true" but "1" at the > end of the line) > > The most odd thing is that I can easily run a bulk import via the local sql > command: > > /ourpeople/import/> > > $ mysql ourpeople_development < import.sql --user=root -p > > > > Where the import.sql contains > > LOAD DATA LOCAL INFILE './output/employees.out.txt' INTO TABLE > employees CHARACTER SET latin1 FIELDS TERMINATED BY ',' IGNORE 1 LINES > ; > > Any suggestions/ideas to what i might be doing wrong? Any examples of > working code you can share? > > > -- > ___________________________________________________________ > > Jesper R?nn-Jensen / Capgemini Denmark > Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 > www.dk.capgemini.com / Blog http://justaddwater.dk/ > jesperrr at gmail.com (Private e-mail and Google Talk IM) > ___________________________________________________________ > _______________________________________________ > Activewarehouse-discuss mailing list > Activewarehouse-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > > From phylae at gmail.com Fri Feb 15 19:06:19 2008 From: phylae at gmail.com (Paul Cortens) Date: Fri, 15 Feb 2008 16:06:19 -0800 Subject: [Activewarehouse-discuss] problems using bulk_import (to mysql on win xp) In-Reply-To: References: Message-ID: are you using the Ruby MySQL gem or the native gem? I had the exact same error when using the Ruby gem. Paul On Feb 15, 2008 3:52 PM, Jesper R?nn-Jensen wrote: > Hi there > I have been trying for days to get bulk import working with > Activewarehouse-ETL > Here is my rule in employees.ctl: > > post_process :bulk_import, { > :file => 'output/employees.out.txt', > :columns => EMPLOYEE_COLS, > :truncate => true, > :field_separator => ',', > :field_enclosure => '"', > #:line_separator => '\n', > :ignore => 1, > :target => :development, > :table => 'employees' > } > > ====This is the error I get when running:==== > > > C:\Documents and Settings\Administrator\My > > Documents\rails\ourpeople\import>etl -c ../config/database.yml --limit 200 > > employees.ctl > > Using AdapterExtensions > > Starting ETL process > > initializing ETL engine > > Processing employees.ctl > > Source: employees.csv > > Limiting enabled: 200 > > Reached limit of 200 > > > > Executing screens > > Screens passed > > > > Executing post processes > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in > > `log': Mysql::Error: #42000The used command is not allowed with this MySQL > > version: LOAD DATA LOCAL INFILE 'C:/Documents and Settings/Administrator/My > > Documents/rails/ourpeople/import/output/employees.out.txt' INTO TABLE > > employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES > > (id,cgid,longid,firstname,lastname,displayname,middleinitial,initials,phone,mobile,fax,subcellphone,email,englishtitle,localtitle,secretary_id,mentor_id,substitute_id,manager_id,comment,licenseplate,employment_cgemployee,employment_cgexternal,employment_cgtemporary,employeework_employeeid,employeework_workpercentage,employeework_actualworkpercentage,company_id,grade_id,location_id,organisation_id,profession_id,resourcetype_id,skillsunit_id,staffingunit_id) > > (ActiveRecord::StatementInvalid) > > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in > > `execute' > > from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/mysql_adapter.rb:46:in > > `do_bulk_load' > > from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/abstract_adapter.rb:18:in > > `bulk_load' > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:73:in > > `process' > > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in > > `transaction' > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:62:in > > `process' > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:485:in > > `post_process' > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:484:in > > `each' > > ... 13 levels... > > from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in > > `require' > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0 > > /bin/etl:28 > > from c:/ruby/bin/etl:19:in `load' > > from c:/ruby/bin/etl:19 > > > ====end of error==== > > I have tried a lot of different combinations of flags in that bulk_import > directive. Am i getting it right? Could you please show me some working > examples. > > Also, for adapter_extensions there seems to be a patch adding this line to > the mysql adapter > > > --- > > activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > > (revision 8484) > > +++ > > activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > > (working copy) > > @@ -467,6 +467,7 @@ > > if encoding > > @connection.options(Mysql::SET_CHARSET_NAME, encoding) > > rescue nil > > end > > + @connection.options(Mysql::OPT_LOCAL_INFILE, true) > > @connection.ssl_set(@config[:sslkey], @config[:sslcert], > > @config[:sslca], @config[:sslcapath], @config[:sslcipher]) if > > @config[:sslkey] > > @connection.real_connect(*@connection_options) > > execute("SET NAMES '#{encoding}'") if encoding > > > > > Well, i did not apply the patch to version 0.4.0 because it seemed like it > was already in the code (however, not "true" but "1" at the > end of the line) > > The most odd thing is that I can easily run a bulk import via the local > sql command: > > > /ourpeople/import/> > > $ mysql ourpeople_development < import.sql --user=root -p > > > > Where the import.sql contains > > > LOAD DATA LOCAL INFILE './output/employees.out.txt' INTO TABLE > > employees CHARACTER SET latin1 FIELDS TERMINATED BY ',' IGNORE 1 LINES > > ; > > > Any suggestions/ideas to what i might be doing wrong? Any examples of > working code you can share? > > > -- > ___________________________________________________________ > > Jesper R?nn-Jensen / Capgemini Denmark > Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 > www.dk.capgemini.com / Blog http://justaddwater.dk/ > jesperrr at gmail.com (Private e-mail and Google Talk IM) > ___________________________________________________________ > _______________________________________________ > Activewarehouse-discuss mailing list > Activewarehouse-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > > -- Ezk. 36 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080215/a2385470/attachment-0001.html From phylae at gmail.com Fri Feb 15 19:09:00 2008 From: phylae at gmail.com (Paul Cortens) Date: Fri, 15 Feb 2008 16:09:00 -0800 Subject: [Activewarehouse-discuss] problems using bulk_import (to mysql on win xp) In-Reply-To: References: Message-ID: Check out this: http://rubyforge.org/pipermail/activewarehouse-discuss/2007-December/000224.html On Feb 15, 2008 4:06 PM, Paul Cortens wrote: > are you using the Ruby MySQL gem or the native gem? > > I had the exact same error when using the Ruby gem. > > Paul > > On Feb 15, 2008 3:52 PM, Jesper R?nn-Jensen wrote: > > > Hi there > > I have been trying for days to get bulk import working with > > Activewarehouse-ETL > > Here is my rule in employees.ctl: > > > > post_process :bulk_import, { > > :file => 'output/employees.out.txt', > > :columns => EMPLOYEE_COLS, > > :truncate => true, > > :field_separator => ',', > > :field_enclosure => '"', > > #:line_separator => '\n', > > :ignore => 1, > > :target => :development, > > :table => 'employees' > > } > > > > ====This is the error I get when running:==== > > > > > C:\Documents and Settings\Administrator\My > > > Documents\rails\ourpeople\import>etl -c ../config/database.yml --limit 200 > > > employees.ctl > > > Using AdapterExtensions > > > Starting ETL process > > > initializing ETL engine > > > Processing employees.ctl > > > Source: employees.csv > > > Limiting enabled: 200 > > > Reached limit of 200 > > > > > > Executing screens > > > Screens passed > > > > > > Executing post processes > > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in > > > `log': Mysql::Error: #42000The used command is not allowed with this MySQL > > > version: LOAD DATA LOCAL INFILE 'C:/Documents and Settings/Administrator/My > > > Documents/rails/ourpeople/import/output/employees.out.txt' INTO TABLE > > > employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES > > > (id,cgid,longid,firstname,lastname,displayname,middleinitial,initials,phone,mobile,fax,subcellphone,email,englishtitle,localtitle,secretary_id,mentor_id,substitute_id,manager_id,comment,licenseplate,employment_cgemployee,employment_cgexternal,employment_cgtemporary,employeework_employeeid,employeework_workpercentage,employeework_actualworkpercentage,company_id,grade_id,location_id,organisation_id,profession_id,resourcetype_id,skillsunit_id,staffingunit_id) > > > (ActiveRecord::StatementInvalid) > > > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in > > > `execute' > > > from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/mysql_adapter.rb:46:in > > > `do_bulk_load' > > > from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/abstract_adapter.rb:18:in > > > `bulk_load' > > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:73:in > > > `process' > > > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in > > > `transaction' > > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:62:in > > > `process' > > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:485:in > > > `post_process' > > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:484:in > > > `each' > > > ... 13 levels... > > > from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in > > > `require' > > > from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0 > > > /bin/etl:28 > > > from c:/ruby/bin/etl:19:in `load' > > > from c:/ruby/bin/etl:19 > > > > > ====end of error==== > > > > I have tried a lot of different combinations of flags in that > > bulk_import directive. Am i getting it right? Could you please show me some > > working examples. > > > > Also, for adapter_extensions there seems to be a patch adding this line > > to the mysql adapter > > > > > --- > > > activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > > > (revision 8484) > > > +++ > > > activerecord/lib/active_record/connection_adapters/mysql_adapter.rb > > > (working copy) > > > @@ -467,6 +467,7 @@ > > > if encoding > > > @connection.options(Mysql::SET_CHARSET_NAME, encoding) > > > rescue nil > > > end > > > + @connection.options(Mysql::OPT_LOCAL_INFILE, true) > > > @connection.ssl_set(@config[:sslkey], @config[:sslcert], > > > @config[:sslca], @config[:sslcapath], @config[:sslcipher]) if > > > @config[:sslkey] > > > @connection.real_connect(*@connection_options) > > > execute("SET NAMES '#{encoding}'") if encoding > > > > > > > > > Well, i did not apply the patch to version 0.4.0 because it seemed like > > it was already in the code (however, not "true" but "1" at the > > end of the line) > > > > The most odd thing is that I can easily run a bulk import via the local > > sql command: > > > > > /ourpeople/import/> > > > $ mysql ourpeople_development < import.sql --user=root -p > > > > > > > Where the import.sql contains > > > > > LOAD DATA LOCAL INFILE './output/employees.out.txt' INTO TABLE > > > employees CHARACTER SET latin1 FIELDS TERMINATED BY ',' IGNORE 1 LINES > > > ; > > > > > > Any suggestions/ideas to what i might be doing wrong? Any examples of > > working code you can share? > > > > > > -- > > ___________________________________________________________ > > > > Jesper R?nn-Jensen / Capgemini Denmark > > Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 > > www.dk.capgemini.com / Blog http://justaddwater.dk/ > > jesperrr at gmail.com (Private e-mail and Google Talk IM) > > ___________________________________________________________ > > _______________________________________________ > > Activewarehouse-discuss mailing list > > Activewarehouse-discuss at rubyforge.org > > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > > > > > > > -- > > > Ezk. 36 -- Ezk. 36 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080215/f486ec81/attachment.html From mghaught at gmail.com Fri Feb 15 19:11:20 2008 From: mghaught at gmail.com (Marty Haught) Date: Fri, 15 Feb 2008 17:11:20 -0700 Subject: [Activewarehouse-discuss] Fwd: problems using bulk_import (to mysql on win xp) In-Reply-To: References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> Message-ID: <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> ---------- Forwarded message ---------- From: Chris Williams Date: Fri, Feb 15, 2008 at 5:09 PM Subject: Re: [Activewarehouse-discuss] problems using bulk_import (to mysql on win xp) To: Marty Haught I just did a gem list on my windows box and this is what it showed for mysql mysql (2.7.1) A win32-native build of the MySQL API module for Ruby. I would uninstall the mysql gem and reinstall to make sure you are using the win32 version. Chris From chris.d.williams at gmail.com Fri Feb 15 19:52:51 2008 From: chris.d.williams at gmail.com (Chris Williams) Date: Fri, 15 Feb 2008 19:52:51 -0500 Subject: [Activewarehouse-discuss] Anyone using AW-ETL with JRuby Message-ID: I am trying to get JRuby to work with some simple etl scripts and I am having issues. A few questions... * I am using the trunk of AW-ETL * What version of active record should I be using? Right now I am at 2.0.2. * I am trying JRuby 1.1RC1 * I updated the etl script to add the following so it would find my jdbc drivers if RUBY_PLATFORM =~ /java/ require 'rubygems' gem 'activerecord-jdbc-adapter' require 'jdbc_adapter' end Below is the error I am seeing jruby -S etl obs_dimension.ctl Using AdapterExtensions C:/projects/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:263:in `load_m issing_constant': uninitialized constant ActiveRecord::Base (NameError) from C:/projects/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:2 53:in `const_missing' from C:/projects/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.1/bin/../lib/etl/engine.rb:3 from C:/projects/jruby-1.1RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 from C:/projects/jruby-1.1RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/projects/jruby-1.1RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/projects/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:4 96:in `new_constants_in' from C:/projects/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:3 18:in `require' from C:/projects/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:4 96 from C:/projects/jruby-1.1RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/projects/jruby-1.1RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/projects/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.1/bin/etl:34 from C:/projects/jruby-1.1RC1/bin/etl:19:in `load' from C:/projects/jruby-1.1RC1/bin/etl:19 from file:/C:/projects/jruby-1.1RC1/lib/jruby.jar!/jruby/commands.rb:14:in `load' from file:/C:/projects/jruby-1.1RC1/lib/jruby.jar!/jruby/commands.rb:14:in `etl' from file:/C:/projects/jruby-1.1RC1/lib/jruby.jar!/jruby/commands.rb:11 Thanks CW From phylae at gmail.com Tue Feb 19 22:07:41 2008 From: phylae at gmail.com (Paul Cortens) Date: Tue, 19 Feb 2008 19:07:41 -0800 Subject: [Activewarehouse-discuss] Fwd: problems using bulk_import (to mysql on win xp) In-Reply-To: <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> Message-ID: Hi, I did some hacking around with the tests for the mysql-2.7 gem, and I can get it to do a bulk import without an error. I didn't go through all of the options (like delimited by, etc). However, when I tried running the adapter_extensions tests, I got errors. I even tried overriding the execute method to remove logging, but that made no difference. I am running out of ideas. Maybe active record uses some weird configuration with MySQL??? Paul On Feb 15, 2008 4:11 PM, Marty Haught wrote: > ---------- Forwarded message ---------- > From: Chris Williams > Date: Fri, Feb 15, 2008 at 5:09 PM > Subject: Re: [Activewarehouse-discuss] problems using bulk_import (to > mysql on win xp) > To: Marty Haught > > > I just did a gem list on my windows box and this is what it showed for > mysql > > mysql (2.7.1) > A win32-native build of the MySQL API module for Ruby. > > I would uninstall the mysql gem and reinstall to make sure you are > using the win32 version. > > Chris > _______________________________________________ > Activewarehouse-discuss mailing list > Activewarehouse-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > -- Ezk. 36 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080219/934b4794/attachment.html From phylae at gmail.com Wed Feb 20 02:51:47 2008 From: phylae at gmail.com (Paul Cortens) Date: Tue, 19 Feb 2008 23:51:47 -0800 Subject: [Activewarehouse-discuss] Fwd: problems using bulk_import (to mysql on win xp) In-Reply-To: References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> Message-ID: I think I have made some progress. I added one line to mysql_adapter.rb in the adapter extensions plugin: Index: ../../lib/adapter_extensions/connection_adapters/mysql_adapter.rb =================================================================== --- ../../lib/adapter_extensions/connection_adapters/mysql_adapter.rb (revision 906) +++ ../../lib/adapter_extensions/connection_adapters/mysql_adapter.rb (working copy) @@ -43,6 +43,9 @@ end q << " IGNORE #{options[:ignore]} LINES" if options[:ignore] q << " (#{options[:columns].join(',')})" if options[:columns] + + @connection = Mysql.new(*@connection_options) + execute(q) end Things seem to be working. It appears that if close() gets run on a Mysql object, you can no longer use LOAD DATA LOCAL INFILE, even if you call real_reconnect(). You have to actually create a new object. However, according to here: http://dev.rubyonrails.org/ticket/9688 the behavior is different (possibly the opposite) when using the pure-Ruby Mysql gem. Does anyone know what kinds of problems I could run into by adding the above line? Will I be messing up all my other active record objects? Cheers, Paul On Feb 19, 2008 7:07 PM, Paul Cortens wrote: > Hi, > > I did some hacking around with the tests for the mysql-2.7 gem, and I can > get it to do a bulk import without an error. I didn't go through all of the > options (like delimited by, etc). > > However, when I tried running the adapter_extensions tests, I got errors. > I even tried overriding the execute method to remove logging, but that made > no difference. > > I am running out of ideas. Maybe active record uses some weird > configuration with MySQL??? > > Paul > > > On Feb 15, 2008 4:11 PM, Marty Haught wrote: > > > ---------- Forwarded message ---------- > > From: Chris Williams > > Date: Fri, Feb 15, 2008 at 5:09 PM > > Subject: Re: [Activewarehouse-discuss] problems using bulk_import (to > > mysql on win xp) > > To: Marty Haught > > > > > > I just did a gem list on my windows box and this is what it showed for > > mysql > > > > mysql (2.7.1) > > A win32-native build of the MySQL API module for Ruby. > > > > I would uninstall the mysql gem and reinstall to make sure you are > > using the win32 version. > > > > Chris > > _______________________________________________ > > Activewarehouse-discuss mailing list > > Activewarehouse-discuss at rubyforge.org > > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > > > > > > -- > > > Ezk. 36 -- Ezk. 36 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080219/7b3108d1/attachment-0001.html From phylae at gmail.com Wed Feb 20 02:55:52 2008 From: phylae at gmail.com (Paul Cortens) Date: Tue, 19 Feb 2008 23:55:52 -0800 Subject: [Activewarehouse-discuss] Fwd: problems using bulk_import (to mysql on win xp) In-Reply-To: References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> Message-ID: That should be real_connect() not real_reconnect(). If anyone is wondering where these method names are coming from, take a look here: http://tmtm.org/en/mysql/ruby/ Paul On Feb 19, 2008 11:51 PM, Paul Cortens wrote: > I think I have made some progress. I added one line to mysql_adapter.rb in > the adapter extensions plugin: > > > Index: ../../lib/adapter_extensions/connection_adapters/mysql_adapter.rb > =================================================================== > --- ../../lib/adapter_extensions/connection_adapters/mysql_adapter.rb > (revision 906) > +++ ../../lib/adapter_extensions/connection_adapters/mysql_adapter.rb > (working copy) > @@ -43,6 +43,9 @@ > end > q << " IGNORE #{options[:ignore]} LINES" if options[:ignore] > q << " (#{options[:columns].join(',')})" if options[:columns] > + > + @connection = Mysql.new(*@connection_options) > + > execute(q) > end > > > Things seem to be working. It appears that if close() gets run on a Mysql > object, you can no longer use LOAD DATA LOCAL INFILE, even if you call > real_reconnect(). You have to actually create a new object. However, > according to here: http://dev.rubyonrails.org/ticket/9688 the behavior is > different (possibly the opposite) when using the pure-Ruby Mysql gem. > > Does anyone know what kinds of problems I could run into by adding the > above line? Will I be messing up all my other active record objects? > > Cheers, > Paul > > > > > > On Feb 19, 2008 7:07 PM, Paul Cortens wrote: > > > Hi, > > > > I did some hacking around with the tests for the mysql-2.7 gem, and I > > can get it to do a bulk import without an error. I didn't go through all of > > the options (like delimited by, etc). > > > > However, when I tried running the adapter_extensions tests, I got > > errors. I even tried overriding the execute method to remove logging, but > > that made no difference. > > > > I am running out of ideas. Maybe active record uses some weird > > configuration with MySQL??? > > > > Paul > > > > > > On Feb 15, 2008 4:11 PM, Marty Haught wrote: > > > > > ---------- Forwarded message ---------- > > > From: Chris Williams > > > Date: Fri, Feb 15, 2008 at 5:09 PM > > > Subject: Re: [Activewarehouse-discuss] problems using bulk_import (to > > > mysql on win xp) > > > To: Marty Haught > > > > > > > > > I just did a gem list on my windows box and this is what it showed for > > > mysql > > > > > > mysql (2.7.1) > > > A win32-native build of the MySQL API module for Ruby. > > > > > > I would uninstall the mysql gem and reinstall to make sure you are > > > using the win32 version. > > > > > > Chris > > > _______________________________________________ > > > Activewarehouse-discuss mailing list > > > Activewarehouse-discuss at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > > > > > > > > > > > -- > > > > > > Ezk. 36 > > > > > -- > > > Ezk. 36 -- Ezk. 36 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080219/955892a9/attachment.html From jesperrr at gmail.com Wed Feb 20 06:27:18 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Wed, 20 Feb 2008 12:27:18 +0100 Subject: [Activewarehouse-discuss] Fwd: problems using bulk_import (to mysql on win xp) In-Reply-To: References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> Message-ID: Hi Paul Thanks for putting effort into this strange weird behaviour. The change you suggest, however, makes no difference for me. I still get the same error. I'm including stack trace below signature. /Jesper On Feb 20, 2008 8:51 AM, Paul Cortens wrote: > I think I have made some progress. I added one line to mysql_adapter.rb in > the adapter extensions plugin: > + @connection = Mysql.new(*@connection_options) > -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ ___________________________________________________________ Executing screens Screens passed Executing post processes c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log': Mysql::Error: #42000The used command is not allowed with this MySQL version: LOAD DATA LOCAL INFILE 'C:/Documents and Settings/Administrator/My Documents/rails/ourpeople/import/output/employees.out.txt' INTO TABLE employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES (id,cgid,longid,firstname,lastname,displayname,middleinitial,initials,phone,mobile,fax,subcellphone,email,englishtitle,localtitle,secretary_id,mentor_id,substitute_id,manager_id,comment,licenseplate,employment_cgemployee,employment_cgexternal,employment_cgtemporary,employeework_employeeid,employeework_workpercentage,employeework_actualworkpercentage,company_id,grade_id,location_id,organisation_id,profession_id,resourcetype_id,skillsunit_id,staffingunit_id) (ActiveRecord::StatementInvalid) from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in `execute' from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/mysql_adapter.rb:49:in `do_bulk_load' from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/abstract_adapter.rb:18:in `bulk_load' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:73:in `process' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:62:in `process' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:485:in `post_process' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:484:in `each' ... 13 levels... from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/etl:28 from c:/ruby/bin/etl:19:in `load' from c:/ruby/bin/etl:19 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080220/d18a54d7/attachment.html From phylae at gmail.com Wed Feb 20 13:46:19 2008 From: phylae at gmail.com (Paul Cortens) Date: Wed, 20 Feb 2008 10:46:19 -0800 Subject: [Activewarehouse-discuss] Fwd: problems using bulk_import (to mysql on win xp) In-Reply-To: References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> Message-ID: <004701c873f0$e1f6eae0$a5e4c0a0$@com> Jesper, Have you tried running the tests that come with the adapter_extensions plugin? Those were the same tests that I was running, so maybe that might help us identify the difference that is causing the problem. Let me know if you need help running the tests. Paul From: activewarehouse-discuss-bounces at rubyforge.org [mailto:activewarehouse-discuss-bounces at rubyforge.org] On Behalf Of Jesper R?nn-Jensen Sent: Wednesday, February 20, 2008 3:27 AM To: activewarehouse-discuss at rubyforge.org Subject: Re: [Activewarehouse-discuss] Fwd: problems using bulk_import (to mysql on win xp) Hi Paul Thanks for putting effort into this strange weird behaviour. The change you suggest, however, makes no difference for me. I still get the same error. I'm including stack trace below signature. /Jesper On Feb 20, 2008 8:51 AM, Paul Cortens wrote: I think I have made some progress. I added one line to mysql_adapter.rb in the adapter extensions plugin: + @connection = Mysql.new(*@connection_options) -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ ___________________________________________________________ Executing screens Screens passed Executing post processes c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in `log': Mysql::Error: #42000The used command is not allowed with this MySQL version: LOAD DATA LOCAL INFILE 'C:/Documents and Settings/Administrator/My Documents/rails/ourpeople/import/output/employees.out.txt' INTO TABLE employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES (id,cgid,longid,firstname,lastname,displayname,middleinitial,initials,phone,mobile,fax,subcellphone,email,englishtitle,localtitle,secretary_id,mentor_id,substitute_id,manager_id,comment,licenseplate,employment_cgemployee,employment_cgexternal,employment_cgtemporary,employeework_employeeid,employeework_workpercentage,employeework_actualworkpercentage,company_id,grade_id,location_id,organisation_id,profession_id,resourcetype_id,skillsunit_id,staffingunit_id) (ActiveRecord::StatementInvalid) from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in `execute' from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/mysql_adapter.rb:49:in `do_bulk_load' from c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/abstract_adapter.rb:18:in `bulk_load' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:73:in `process' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:62:in `process' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:485:in `post_process' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:484:in `each' ... 13 levels... from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/etl:28 from c:/ruby/bin/etl:19:in `load' from c:/ruby/bin/etl:19 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080220/bc9014be/attachment-0001.html From mwlang at mdlogix.com Thu Feb 21 12:37:11 2008 From: mwlang at mdlogix.com (Michael Lang) Date: Thu, 21 Feb 2008 12:37:11 -0500 Subject: [Activewarehouse-discuss] Helper Tables Support? In-Reply-To: <004701c873f0$e1f6eae0$a5e4c0a0$@com> References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> <004701c873f0$e1f6eae0$a5e4c0a0$@com> Message-ID: <47BDB6C7.6030404@mdlogix.com> Does the Active Warehouse project support the notion of "Helper Tables"? In other words, many-to-many relationships between important dimensions. http://www.dbmsmag.com/9808d05.html http://www.intelligententerprise.com/010810/412warehouse1_1.jhtml For my particular example. - I have a table of patients. - I have a table of visits for those patients, each visit having a primary diagnosis. - I have another table of patient diagnoses keyed off the visits table in which those patients have between 1 (the primary diagnosis in the table of visit is duplicated here) to as many as 30 diagnoses ascribed to them. Each diagnosis is an additional row in this table. So, that is: Patients >-- Visits >-- Diagnoses I want to ask the question: "how many patients came in for a visit who were diagnosed with A as primary symptom and also had B diagnosed at the time of visitation?" Helper tables seems to be the way to go, but I'm not sure how to do the weighted_value column nor how to leverage the Active Warehouse components for this. Any suggestions on how to proceed to model such that I'm not counting the same patient twice regardless of number of visits or number of diagnoses recorded for a visit? Regards, Michael From mwlang at mdlogix.com Tue Feb 26 09:54:10 2008 From: mwlang at mdlogix.com (Michael Lang) Date: Tue, 26 Feb 2008 09:54:10 -0500 Subject: [Activewarehouse-discuss] Where to report bugs? In-Reply-To: References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> Message-ID: <47C42812.1010809@mdlogix.com> Where's the best place to report bugs? When using the database_destination and truncate == true, only the last 32 records are actually manifested. From database_destination.rb, it looks like the table is repeated truncated during processing (every time the buffer is flushed)... # Flush the currently buffered data def flush conn = ETL::Engine.connection(target) conn.transaction do conn.truncate(table_name) if truncate Setting truncate to false and emptying table manually allowed me to fully load the data. One other thing: I, too am experiencing issues with the bulk load approach. The odd thing is that it works sometimes. For example, worked fine for four or five smaller dimension tables, but will not work for larger dimension tables. When it does fail, I see the LOAD DATA sql in the etl.log file and pasting this SQL into the MySQL console is failing, as well, so not likely Active Record issue. Regards, Michael Jesper R?nn-Jensen wrote: > Hi Paul > Thanks for putting effort into this strange weird behaviour. > > The change you suggest, however, makes no difference for me. I still > get the same error. I'm including stack trace below signature. > > /Jesper > > > On Feb 20, 2008 8:51 AM, Paul Cortens wrote: > > I think I have made some progress. I added one line to > mysql_adapter.rb in the adapter extensions plugin: > + @connection = Mysql.new(*@connection_options) > > > > > -- > ___________________________________________________________ > > Jesper R?nn-Jensen / Capgemini Denmark > Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 > www.dk.capgemini.com / Blog > http://justaddwater.dk/ > ___________________________________________________________ > > Executing screens > Screens passed > > Executing post processes > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:150:in > `log': Mysql::Error: #42000The used command is not allowed with this > MySQL version: LOAD DATA LOCAL INFILE 'C:/Documents and > Settings/Administrator/My > Documents/rails/ourpeople/import/output/employees.out.txt' INTO TABLE > employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES > (id,cgid,longid,firstname,lastname,displayname,middleinitial,initials,phone,mobile,fax,subcellphone,email,englishtitle,localtitle,secretary_id,mentor_id,substitute_id,manager_id,comment,licenseplate,employment_cgemployee,employment_cgexternal,employment_cgtemporary,employeework_employeeid,employeework_workpercentage,employeework_actualworkpercentage,company_id,grade_id,location_id,organisation_id,profession_id,resourcetype_id,skillsunit_id,staffingunit_id) > (ActiveRecord::StatementInvalid) > from > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/mysql_adapter.rb:281:in > `execute' > from > c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/mysql_adapter.rb:49:in > `do_bulk_load' > from > c:/ruby/lib/ruby/gems/1.8/gems/adapter_extensions-0.4.0/lib/adapter_extensions/connection_adapters/abstract_adapter.rb:18:in > `bulk_load' > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:73:in > `process' > from > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in > `transaction' > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/processor/bulk_import_processor.rb:62:in > `process' > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:485:in > `post_process' > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/../lib/etl/engine.rb:484:in > `each' > ... 13 levels... > from > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in > `require' > from > c:/ruby/lib/ruby/gems/1.8/gems/activewarehouse-etl-0.9.0/bin/etl:28 > from c:/ruby/bin/etl:19:in `load' > from c:/ruby/bin/etl:19 > > ------------------------------------------------------------------------ > > _______________________________________________ > Activewarehouse-discuss mailing list > Activewarehouse-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > From thibaut.barrere at gmail.com Tue Feb 26 10:06:48 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Tue, 26 Feb 2008 16:06:48 +0100 Subject: [Activewarehouse-discuss] Where to report bugs? In-Reply-To: <47C42812.1010809@mdlogix.com> References: <57f29e620802151558w19c76639o6dfa985345ee51a7@mail.gmail.com> <57f29e620802151611h737e1d23s1d0d4da17a4647a3@mail.gmail.com> <47C42812.1010809@mdlogix.com> Message-ID: <4a68b8cf0802260706j39fa3f65k21bcb8cc9162995f@mail.gmail.com> Hi Michael Where's the best place to report bugs? I'm not sure - but here seems to be fine (someone else ?). One other thing: I, too am experiencing issues with the bulk load > approach. The odd thing is that it works sometimes. For example, > worked fine for four or five smaller dimension tables, but will not work > for larger dimension tables. When it does fail, I see the LOAD DATA sql > in the etl.log file and pasting this SQL into the MySQL console is > failing, as well, so not likely Active Record issue. On this specific topic, I remember I had issues caused by MySQL itself (timeout because of packets too large). We had mail exchanges with Anthony as well. The solution I came up with was to split the uploaded file in chunks. A patch to do this is available here: http://rubyforge.org/pipermail/activewarehouse-discuss/2007-September/000179.html hope this helps, Thibaut Barr?re -- LoGeek [blog] http://blog.logeek.fr - learning content for developers [blog] http://evolvingworker.com - tools for a better day -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080226/30044d71/attachment.html From jesperrr at gmail.com Wed Feb 27 14:49:36 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Wed, 27 Feb 2008 20:49:36 +0100 Subject: [Activewarehouse-discuss] Fwd: Your message to Activewarehouse-discuss awaits moderator approval In-Reply-To: References: Message-ID: Hi there. Who will moderate my message and approve it? I sent a 55kb patch file with documentation updates, but nobody has approved it yet. Does anybody know who have administrative rights on this list?? Cheers, Jesper -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ ___________________________________________________________ ---------- Forwarded message ---------- From: Date: Sat, Feb 16, 2008 at 12:24 AM Subject: Your message to Activewarehouse-discuss awaits moderator approval To: jesperrr at gmail.com Your mail to 'Activewarehouse-discuss' with the subject Final documentation update for ActiveWarehouse-etl Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 55436 bytes with a limit of 40 KB Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: [removed by Jesper] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080227/251cb6e8/attachment.html From jesperrr at gmail.com Fri Feb 15 18:24:36 2008 From: jesperrr at gmail.com (=?UTF-8?Q?Jesper_R=C3=B8nn-Jensen?=) Date: Sat, 16 Feb 2008 00:24:36 +0100 Subject: [Activewarehouse-discuss] Final documentation update for ActiveWarehouse-etl Message-ID: Hi there (so silent in this forum??? Hope somebody is listening... Here are my final additions to the documentation (as you know i have basically just copied from the user guide...) I am still not satisfied with the level of documentation... I still think there could be more examples put in, some files/features are still not documented, etc. This is what's fixed in patch_04 (which contains all changes including the earlier patches) trunk/lib/etl/processor/bulk_import_processor.rb => added :ignore flag that was not there trunk/lib/etl/parser/delimited_parser.rb => fixed toggled line/file in error msg All files: Documentation updates /Jesper PS i also encountered some errors that i should probably ask you for help about... but that would be in other mails... -- ___________________________________________________________ Jesper R?nn-Jensen / Capgemini Denmark Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 www.dk.capgemini.com / Blog http://justaddwater.dk/ jesperrr at gmail.com (Private e-mail and Google Talk IM) ___________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080216/858bc21d/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: documentation_patch_04.patch Type: application/octet-stream Size: 38569 bytes Desc: not available Url : http://rubyforge.org/pipermail/activewarehouse-discuss/attachments/20080216/858bc21d/attachment-0001.obj From anthonyeden at gmail.com Thu Feb 28 06:26:15 2008 From: anthonyeden at gmail.com (Anthony Eden) Date: Thu, 28 Feb 2008 06:26:15 -0500 Subject: [Activewarehouse-discuss] Fwd: Your message to Activewarehouse-discuss awaits moderator approval In-Reply-To: References: Message-ID: I approved it. In the future you may want to consider uploading patches to the Patches section of the RubyForge page: http://rubyforge.org/tracker/?atid=9386&group_id=2435&func=browse V/r Anthony On Wed, Feb 27, 2008 at 2:49 PM, Jesper R?nn-Jensen wrote: > Hi there. > Who will moderate my message and approve it? I sent a 55kb patch file with > documentation updates, but nobody has approved it yet. > > Does anybody know who have administrative rights on this list?? > > Cheers, > Jesper > > > > -- > ___________________________________________________________ > > Jesper R?nn-Jensen / Capgemini Denmark > Tel. +45 3977 8220 / Mob. +45 2373 6220 / Fax +45 7011 2201 > www.dk.capgemini.com / Blog http://justaddwater.dk/ > ___________________________________________________________ > > ---------- Forwarded message ---------- > From: > Date: Sat, Feb 16, 2008 at 12:24 AM > Subject: Your message to Activewarehouse-discuss awaits moderator approval > To: jesperrr at gmail.com > > > Your mail to 'Activewarehouse-discuss' with the subject > > Final documentation update for ActiveWarehouse-etl > > Is being held until the list moderator can review it for approval. > > The reason it is being held: > > Message body is too big: 55436 bytes with a limit of 40 KB > > Either the message will get posted to the list, or you will receive > notification of the moderator's decision. If you would like to cancel > this posting, please visit the following URL: [removed by Jesper] > > > > > > > _______________________________________________ > Activewarehouse-discuss mailing list > Activewarehouse-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/activewarehouse-discuss > >