How to execute a single line from a paragraph in Apache Zeppelin? - apache-zeppelin

I tend to group similar actions in one paragraph, but each action can take a long time. Is there a way to execute only one line within a paragraph?

As of today, Zeppelin does not provide this option to execute single lines from a paragraph. Refer this link.

Related

Print Statements from SQL file in command prompt

I am executing a SQL file which contains basic create table and lot of insert statements from command prompt. Since there are huge number of inserts, i want to track how many inserts are done. To do that i want to add few statements describing start and end of certain section in the sql file. I want this statement printed in the command prompt itself . Is there anyway i can do this?
Either print or message will do the trick. You can follow the examples inside each link.
In some specific cases you can also simply do SELECT "Some custom message...";

How to create a logic app which creates a tab-delimited table?

Right now, I run a stored procedure whose output feeds a "Create CSV Table" Data Operations component. This component, not surprisingly, outputs a comma-delimited list of fields, which is not supported by our remote system. The fields need to be tab-delimited. One would think that the Data Operations component would have a tab (or other character-delimited option). But no, only commas are available, and no other Data Operations component outputs a tab-delimited table.
Using any mechanism for which we'd have to write code is completely the last option, as there's no need for code to use CSV. Also, any mechanism which requires paying for 3rd party components is categorically out, as is using any solution which is in preview mode.
The only option we've thought of is to revamp the stored procedure which outputs a single "column" containing the tab-delimited columns, and then output to a file - ostensibly, a comma-delimited file, but one without commas embedded inside (which is allowed for my system) so that the single column isn't itself enquoted.
Otherwise, I guess Function Apps is the solution. Anyone with ideas?
The easiest way is to use string function and replace comma with other delimiter. If you could accept this way, after creating the csv table I initiate a string variable with this input replace(body('Create_CSV_table_2'),',',' ').
And this is the result.
And if you don't want this way, yes you have to solve it with code and the Function is a choice.

How to add one more path in SSIS data flow

Hi,
I try to use same data twice in SSIS data flow panel, however, it only allow me to build one path, is there anyway I can build another path of it or I can duplicate the data I want to use?
Thanks,
You're looking for multi cast transformation.
Connect the above 'CONVERT DATA TYPE2' TO 'MULICAST TRANSFORMATION'.
From multicast you can take anynumber of outtflows.
There are 2 ways to add a path, it depends on your requirements:
Multicast transformation
The Multicast transformation distributes its input to one or more outputs. This transformation is similar to the Conditional Split transformation. Both transformations direct an input to multiple outputs. The difference between the two is that the Multicast transformation directs every row to every output, and the Conditional Split directs a row to a single output
Script Component multiple outputs
If you are looking to create many distinct path based on the script component code, then script component allow creating many outputs. (check the link above for more details)
Option 1
The best and most SSIS way of doing this is by using the Multicast component. Connect it to the output path of your Script Transformation "Convert data type 2" and from there, you can connect it to both "Sort 1" and "Sort 3"
Option 2
If your Script Transformation is asynchronous (1 row in to many rows out, many rows in to 1 out, etc) then you could add a second output and also send the data along. That answer is only provided for completeness. Doing this would cause the amount of data required for a row in your pipeline to double (the Multicast component does some pointer reference voodoo to not physically duplicate the data)
Finally, I'm not sure what business problem you're solving but if performance is an issue, it'll be the package design and not SSIS itself. Without knowing more (aka a difference quest

SSIS: Adding multiple Derived Columns without using the gui?

I have about 500 fixed width columns in a flat file that I want to apply the same logic to to replace an empty column with null before it goes into the database.
I know the command to replace the empty string with null but I really don't want to have to use the gui to input that command for every column.
So is there a tool out there that can do this all on the back end?
You could look at something like the EzAPI to create your data flow. This this answer, I have an example of how one creates a EzDerivedColumn and sets the formula within it.
Automatically mapping columns with EZApi with OLEDBSource
If you can install third party components, I've seen a number of implementations of a Trim-To-Null functionality on codeplex.com
BIML might be an option to generate your package as well. I'd need to play with that to figure the syntax though.
My googlefu worked a little better after lunch.
I as able to modify about the 5th comment down on http://social.msdn.microsoft.com/Forums/sqlserver/en-US/222e70f5-0a21-4bb8-a3fc-3f365d9c701f/ssis-custom-component-derivedcolumn-programmatically-problems?forum=sqlintegrationservices to work for my needs.
My c# code will now loop through all the input columns from a "Flat File Source" object and add a derived column for each.

How to add comments in SOQL

Is it possible to put comments in SOQL?
The Force.com explorer doesn't support basic operations like undo/redo and I can't find any way to enter comments so experimenting with queries is painful.
I've tried all the usual suspects --, #, /*, //
No, I don't think there's a way to use comments in SOQL. You can comment out pieces of queries you've issued in Apex though.
There are some tools that you might like more than the official Flash-based Explorer and the sluggish querying utility in Eclipse IDE.
My favorite is Real Force Explorer - has the searchable history of SOQL and Apex snippets, you can select the piece you want to run if you have several queries (like in Oracle's SQLDeveloper)...
I've heard some good stuff about BrainEngine too, didn't try it yet (basic version is free, cough up cash for more). The screenshots look tempting ;)
You might also like web-based tools like the official Workbench - if you're not a fan of providing the credentials in the officially hosted one you can download it and host it on your own machine.
Last but not least - JitterBit Data Loader got promoted some time ago to be listed in Setup pages. Haven't played with it either (might be it's just a data loader, not really suited for query editor tasks).
If you're SQL Server guy - have a look at DBAmp ($$$ again). I doubt it's the only connector to Salesforce, there have to be some more ODBC-like translation attempts. So you might be able to find a plugin for your favorite SQL editor after all.
(no, I'm not related to any of companies or projects behind these links)
If you are writing inline SOQL inside of Apex, you can add Apex comments. Both block and single-line comments work.
You can verify this in the Execute Anonymous Window in the Developer Console:
List<Account> accounts = [
SELECT ID From Account
// single line comment
WHERE Name = 'Test' /* block comment */
];
The Execution log shows that the comments are removed from the actual query:
SOQL_EXECUTE_BEGIN [1]|Aggregations:0|SELECT ID FROM Account WHERE Name = 'Test'
I use SOQL Studio from VisualSoftwareSystems.net. It supports line comments and block comments as well as full syntax highlighting.
OK, in SOQL you don't have the usual commenting mechanism. So now it's time for Boolean phantoms: appending an OR clause that can never be true, but contains comment info. Something like this:
SELECT id FROM Account WHERE Name = 'IBM' OR Name = 'This is the comment text explaining what this query is for'
This bit of hackery will slow down the query a little tiny bit...but if you simply must put the comment inside the SOQL (rather than at the end of the line invoking it), it does work.

Resources