Does Apache Drill Support Excel Files (.xls) - apache-drill

I am trying to query for excel files (.xls) through dfs storage plugin:-
select * from dfs.`E:/Demos/Sample.xls`;
But It throwing some error:--
org.apache.drill.common.exceptions.UserRemoteException: VALIDATION ERROR: From line 1, column 15 to line 1, column 17: Table 'dfs.E:/Demos/Sample.xls' not found SQL Query null
Same Problem with Ms Access file.
if i query through some Microsoft Access(.accdb)files, It throwing error.
My Question is :- Whether Apache Drill Supports Excel and Ms Access Files or not.???

Also there is an open PR for Excel plugin in Apache Drill (https://github.com/apache/drill/pull/1749), so most likely it will be available in Drill 1.17.

There is a storage plugin for Apache Drill available that supports querying Excel files: https://github.com/bizreach/drill-excel-plugin

Drill doesn't currently support querying MS Excel or Access files directly.
Someone asked a similar question on Drill's mailing list and Andries gave him the following answer:
You can use the Drill ODBC driver, and then query Drill using MS Query
or the same way you would query another DB engine through an ODBC DSN.

This feature is now integrated into Drill.

Related

SSRS Issues with 32bit and 64bit ODBC drivers

The ultimate goal is for users to be able to run a report that looks pretty and grabs current information from our database. We'd like to use SQL Report Builder since we're already using it for other reports. The database is Cisco UCCX and we're accessing it with an ODBC connection from our reporting services SQL Server 2008 R2.
We've successfully setup System ODBC connections with both 64bit and 32bit drivers. When trying to access the connections though, we're receiving errors.
Using the 32bit driver, we try to create a Data Source in SSRS for use by Report Builder and receive the error:
"ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application"
Using the 64bit driver, we can successfully create and test the ODBC connection as a Data Source, but then when we attempt to create a Dataset with it in Report Builder, we get this error:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Error received using the 64bit driver for ODBC connection
I ran into this recently. You need to have the same name for both 32 and 64bit DSNs. It's annoying because SSRS can run 64bit, but reportbuilder only exists in 32bit. So parts of reportbuilder seem to work (like running queries), but some don't (like refreshing query fields). Just have a DSN for both 32bit and 64bit, then make sure they're both the same name and the problems should stop.
You may be hitting an old but recurring issue with minor corruption in the Windows Registry.
The corruption takes the form of entries containing this 4-character string —
#=""
These entries aren't visible anywhere except Registry export files — the Registry Editor ignores them completely — but they can lead to a number of undesired behaviors, including the error you report.
NOTE: On your 64-bit Windows machine, there are naturally some complications tied to the 32-bit Registry. This Microsoft KB article may be sufficient to get you through these.
I suggest that you use the 64-bit Registry Editor (%systemroot%\system32\regedit) to export the following branches (where these problematic entries tend to be found) —
HKEY_LOCAL_MACHINE\Software\ODBC
HKEY_CURRENT_USER\Software\ODBC
HKEY_LOCAL_MACHINE\Software\WOW6432Node\ODBC
HKEY_CURRENT_USER\Software\WOW6432Node\ODBC
Edit these files in any text editor (Notepad or Wordpad are generally fine), and delete all lines which consist of that 4-character string, above. Then, delete the Registry tree segment(s) you exported, and import from the edited files — thereby restoring the tree segment(s), minus the corruption.
It won't hurt to repeat the above process with the 32-bit Registry Editor (%systemroot%\syswow64\regedit), but as you've described the issue, I don't think you'll find any #="" in the 32-bit export.

copy table content to same table on other sql server

I have used the wizard from http://sqlazuremw.codeplex.com/ to move my database from:
Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64)
Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (VM)
to
Microsoft SQL Azure (RTM) - 11.0.9164.122
Which worked great, but there was a table with over a gigabyte of rubbish data. So I stopped the process. Now it copied a table structure, but forgot to fill the content. I will have to fix this manually with query:
-- when connected to the azure db
select into azureDb.dbo.tablename select * onPremisesServer.onPremisesDb.dbo.tablename
But when I execute it, I get:
Msg 40515, Level 15, State 1, Line 16
Reference to database and/or server name in 'onPremisesServer.onPremisesDb.dbo.tablename' is not supported in this version of SQL Server.
I have found Cannot get Linked Servers to work in Sql Azure and it says that it is client related. So I looked up my version of SSMS:
Microsoft SQL Server Management Studio 11.0.3128.0
So that cannot cause this. I have also had troubles with the 'onPremisesServer' being just an ip address and had to execute select name from sys.servers to find a server alias instead of using [ipadres] for onPremisesServer. Still cannot get it to work. The tables have exactly the same schema.
edit as DeicLone123 mentioned, I used import and export data. I have renamed the table to tablename-old on azure and ran the wizard and got:
I used the 3.x again from http://sqlazuremw.codeplex.com/ to migrate just that last table. Easy as that! Manually transferring the data, column types etc. is a real pain.. So this open source migration tool is really recommended!

Oracle SQL Developer Error: vendor code 1317

I am using Oracle SQL Developer to browse a MySQL database. When I browse table with Columns tab (shows table definitions), some of tables will display an Error Encountered dialog that says:
Vendor code 1317
Are you using the latest version of SQL Developer?
Might be worth asking this question on the SQL Developer Forum on OTN as it is well supported by the Oracle SQL Developer team.
I had a quick search and the only thread I could find was this one in which one of the responses reports the same problem as you but unfortunately there is not a direct response to it.
SQL Developer doesn't support 5.1.x series of jdbc mysql connector... you need to set up sql developer to use mysql-connector-java-5.0.4 in driver settings. You better use this one, because I was having the issue even with mysql-connector-java-5.0.8
To browse MYSQL DB with version Oracle SQL Developer (version 2.1.2.64) and avoid the above problem, you must use mysql/J connector: mysql-connector-java-5.0.4.
mysql-connector-java-5.0.8 or mysql-connector-java-5.1.* WILL NOT work.
1317 seems to be the mySQL code for ER_QUERY_INTERRUPTED.
Maybe some sort of timeout ?
Please check the following link for the answer
http://download.oracle.com/docs/cd/E15846_01/doc.21/e15222/intro.htm#CHDIEGDD
This is an excerpt from the above link:
Database: Third Party JDBC Drivers
The Third Party JDBC Drivers pane
specifies drivers to be used for
connections to third-party
(non-Oracle) databases, such as IBM
DB2, MySQL, Microsoft SQL Server, or
Sybase Adaptive Server. (You do not
need to add a driver for connections
to Microsoft Access databases.) To add
a driver, click Add Entry and select
the path for the driver:
For IBM DB2: the db2jcc.jar and
db2jcc_license_cu.jar files, which are
available from IBM
For MySQL: a file with a name similar
to mysql-connector-java-5.0.4-bin.jar,
in a directory under the one into
which you unzipped the download for
the MySQL driver
For Microsoft SQL Server or Sybase
Adaptive Server: jtds-1.2.jar, which
is included in the jtds-1.2-dist.zip
download
For Teradata: tdgssconfig.jar and
terajdbc4.jar, which are included
(along with a readme.txt file) in the
TeraJDBC__indep_indep.12.00.00.110.zip
or
TeraJDBC__indep_indep.12.00.00.110.tar
download
Alternative: As an alternative to
using this preference, you can click
Help, then Check for Updates to
install the JTDS JDBC Driver for
Microsoft SQL Server and the MySQL
JDBE Driver as extensions.
To find a specific third-party JDBC
driver, see the appropriate Web site.
For MySQL, use the MySQL 5.0 driver, not
5.1 or later, with SQL Developer release 1.5.
You must specify a third-party JDBC
driver or install a driver using the
Check for Updates feature before you
can create a database connection to a
third-party database of that
associated type. (See the tabs for
creating connections to third-party
databases in the Create/Edit/Select
Database Connection dialog box.)

SSIS data Import from MySql

I am working with SSIS and trying to import data from MySql to SQL Server. I am having issues trying to convert mySql datetimes to SQL Server Datetimes. Any suggestions?
Can you provide an example of the error or problem? I found some values in MySQL were out of range to SQL Server. In these instances, I used a NULLIF on the MySQL side to remove the bad values first. Rafal Ziolkowski's solution of converting to strings could work as well, but I personally would prefer to push the conversion off to the MySQL query if it is only impacting data columns.
Try convert date to string and then to datetime again.
What is the issue? Which SSIS data type are you using? DT-DBTIMESTAMP should work for both.
this took me few days to figure out...so I thought I would share my notes
How to connect and load data from MySQL to SQL Server
Download the 32 bit ODBC driver.
go to the MySQL website and download: “mysql-connector-odbc-5.2.4-ansi-win32.msi”
NOTE: Do not use the 64 bit driver on BIDS 2008. BIDS 2008 is 32 bit. You will get a mismatch error when creating SSIS’s connection manager: “The specified DSN contains an architecture mismatch between the Driver and Application”
Create a User DSN
You need to open the using windows 32 ODBC admin tool. DO NOT open the regular ODBC admin, in control panel. Open the ODBC admin located here: c:\Windows\SysWOW64\odbcad32.exe. If you use the default ODBC admin…it will not work. Additionally you must create a “User DSN” - NOT a System DSN. Otherwise it will not show up in SSIS
NOTE: the screens look the same so you will have no way of knowing whether you are in 32 BIT ODBC Admin tool or not.
Create a new SSIS package and create an ADO.NET connection manager:
Change the Source ADO.NET properties.
You will get validation errors and your package will not run. You need to change the “ValidateExternalMetadata” to FALSE (in the “Advanced Editor” dialog box) of the ADO.NET source It will also give you metadata error…that’s ok…just click ok. It will still pull the metadata (column names/data types). You cannot select the tables as you would in SQL server. You need to type the SQL select statement.
Run the package and should run and load normally.

Migrating from MS SQL to MySQL: SQLOLEDB? Migration kit login error?

I've been put in charge of migrating a customer's website of MS SQL/ASP to PHP/MYSQL. I have zero experience with MS SQL.
I'm trying to figure out the best way to get the current data migrated to MySQL so I can begin PHP development.
Some details:
I downloaded SQL Server Mangement Studio Express. I found the following string in a connection file:
MM_connCompanyName_STRING = "provider=SQLOLEDB;data source=IP_ADDRESS;database=DATABASENAME;uid=USERNAMEpwd=PASSWORD;"
Using the IP, username, and password from this string, I could successfully connect using Studio Express.
I downloaded the MySQL Migration Toolkit and entered the same info, but get the following error:
Connecting to source database and retrieve schemata names.
Initializing JDBC driver ...
Driver class MS SQL JDBC Driver
Opening connection ...
Connection jdbc:jtds:sqlserver://IP_ADDRESS:1433/DATABASENAME;user=USERNAME;password=PASSWORD;";charset=utf-8;domain=
The list of schema names could not be retrieved (error: 0).
ReverseEngineeringMssql.getSchemata :Login failed for user 'USERNAME'.
I don't have admin or physical access to the current SQL server. I've tried to run some exports through Studio Express, but it saves them to the file system, which I don't have access to.
I can reach the current/old webmaster, but because he no longer works for the company, his responses are slow and usually un-helpful. So no help there...
The former admin sent me an MDF file ... no idea what to do with that.
I found this note above the connection info on the current server (if it means anything):
'this connection is being used because
ODBC was causing weird errors,
switching to OLEDB fixed them
My questions:
Any idea why this would be failing with the same login credentials that works with Studio Express? I'm assuming it has something to do with the driver, but I don't know what next steps to take.
Is there a better/easier/more effective way to migrate this data? (I'm hoping I don't find myself running "SELECT *" statements in Studio Express and copy/pasting data into Excel...please god, no)
Thanks in advance for your help.
Eww, this is going to be scary (connection string indicates it was tool generated from Dreamweaver, never a good sign).
Any idea which version of SQL Server? You should be able to SELECT ##VERSION. 10.x is 2008, 9.x is 2005 and 8.x is 2000. If it is 7.x run.
The MDF file is the actual database. If I were you, I would buy a developer edition of SQL 2005 (or 8 if it is 2008 which is unlikely), it will be worth the $99 or so it costs.
This will give you the ability to locally install the DB by ATTACHing the MDF file. Once you have a locally running copy, you can use the SQL Server ETL tools with the MySql ODBC drivers to push the data to MySql in a repeatable manner.
I believe you can export data from MSSQL choosing different SQL dialects; I believe there's one that's reasonably MySQL compatible. It doesn't solve all your problems, of course, because while you may get the structure properly, stored procedures and triggers and the like will take a bit more work. But that should get you started.