Posts

Showing posts from 2015

utf8_general_ci VS utf8_unicode_ci what should we use?

These two collations are both for the UTF-8 character encoding. The differences are in how text is sorted and compared. Note: in new versions of MySQL use utf8mb4 , rather than utf8 , which is the same UTF-8 data format with same performance but previously only accepted the first 65,536 Unicode characters. Accuracy utf8mb4_unicode_ci is based on the Unicode standard for sorting and comparison, which sorts accurately in a very wide range of languages. utf8mb4_general_ci fails to implement all of the Unicode sorting rules, which will result in undesirable sorting in some situations, such as when using particular languages or characters. Performance utf8mb4_general_ci is faster at comparisons and sorting, because it takes a bunch of performance-related shortcuts. On modern servers, this performance boost will be all but negligible. It was devised in a time when servers had a tiny fraction of the CPU performance of today's computers. utf8mb4_unicode_c

How to show records in same order where IDs are put into the IN() clause?

    How to show records in same order where IDs are put into the IN() clause?     1) SELECT id FROM table1 WHERE ... ORDER BY display_order , name 2) SELECT name , description , ... WHERE id IN ([ id ' s from first ])   The issue is that the second query does not return the results in the same order  that the IDs are put into the IN() clause.    Solution :-  SELECT name , description , ... FROM ... WHERE id IN ([ ids , any order ]) ORDER BY FIELD ( id , [ ids in order ])

Is a BLOB converted using the current/default charset in MySQL?

Blob data used MySQL charset which is in my.ini default-character-set=latin1 Suppose I have a table with a BLOB field. The charset of the table is UTF-8. I connect to the DB and "SET CHARACTER SET utf8". Then I save binary data into the field. Then I retrieve the data, and it's not what I saved (corrupt). Because while retrieving data blob data used mysql default charset set. Ref : http://stackoverflow.com/questions/14734812/is-a-blob-converted-using-the-current-default-charset-in-mysql

Pentaho/R Integration Plugin

Image
http://dekarlab.de/wp/?p=5 Pentaho R Integration Plugin is used to execute R code direct from Pentaho Data Integration (PDI). R Script Plugin can be downloaded here:  Downloads Installation R script plugin can be installed by performing the following steps: 1) Copy the plugin folder (RScriptPlugin) into the folder of your PDI installation: data-integration\plugins\steps 2) Install R project from the site http://www.r-project.org/ 3) Install rJava package in R by executing: install.packages(“rJava”) 4) Copy JRI library rJava/jri/jri.dll (windows) or rJava/jri/libjri.so (linux) to: data-integration/libswt/{your operation system} 5) Specify location of R using R_HOME environment variable. (like: C:\R\R-3.0.2). 6) For windows, it is also needed to put in PATH variable the path to R.dll, for example: C:\R\R-3.0.2\bin\{your operation system} 7) The plugin can be found under Sripting Folder in Design Tab: Note: to check the installation press Help bu