Accessing Parquet files form Teiid - parquet

Can Teiid be used to access parquet files stored in external directory (out side the web container) in Wildfly web application? Appreciate any help on this

yes, you can here is the translator [1] the data can be in a file, hdfs or S3 is done as part of [2]. You can see an example in WildFly here [3].
it looks like we have not added in the Teiid SpringBoot, but should be simple enough to add if you are using that.
[1] http://teiid.github.io/teiid-documents/master/content/reference/r_parquet-translator.html
[2] https://issues.redhat.com/browse/TEIID-4594
[3] https://github.com/teiid/teiid/blob/master/wildfly/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestParquet.java

Related

Can I just add an application.properties file to a Spring Boot project?

I'm fairly new to Spring Boot and MongoDB. Currently I have a project that can send data back and forth to a server that is running locally on my computer, but I want to change this and make it edit and retrieve data from an externally running database. In other tutorials I have followed I have had an application.properties file that I can edit details in to get it to connect, but I can't find this in any of the sub folders (I pulled the code from a tutorial) and I can't find anything to say that it is specifically connecting to the local instance.
Would it be okay to just create the application.properties file in the right sub folder and enter the external database's details there? Or am I going to have to try a separate method and tutorial to try and connect to the external database in another way?
I have a feeling that to answer it you will need to see/understand more of the code, but I'm not sure how to summarise anything else or what would actually be relevant. Thank you.
Spring Boot has several default folders, where it searches for properties.
One of those places is for example src/main/resources/application.properties, there you can just create this file.
An overview of other possible places for Spring Boot properties can be found here:
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
In my German blog I wrote an article about how to use Spring-data to access MongoDB - there I used also application.properties file:
https://agile-coding.blogspot.com/2020/10/keine-ahnung-von-mongodb-dann-nimm.html

Persisting data within the Spring Boot app

I am creating a small application using Spring Boot, this application allows users to store XML templates which can be reused in various scenarios.
The XML templates are small and will be less that 100 lines each, also there will not be more than 20 templates. I don't want to use a separate database to store this small information.
Also I don't want to store this information in memory as I want to retain the data when the app is restarted.
What is the suggested option to store this kind of data within the Spring Boot app itself without using an external database ?
Use H2 database with in memory db or save it on local disk. Or you can go for plain old write file to disk and just write a file to the disk and have another file to keep track of meta information for your writes. But this will help you only if you can ensure you have access to servers and they in turn are not volatile. Spring boot as such has not out of box solution for this other than embedded database

small emebedded database for spring data

I try to write a small web application with a restfull frontend to manage a little amount of data (round about 30 datasets). I want to create a PDF file from the datasets (using iText, but this is not the Problem). I search now a small database, which I can embed in my application an which persists the data somewhere on my Harddisc (if possible no Client / Server database), but I find no example / tutorial for this. All tutorial I found using a database in in-Memory mode, which is not what I need. Is there somewhere a nice tutorial helping me? Which database would you sugest to use in my Situation?
Thanks for your help and
Kind regards,
Andreas Grund
You can use H2, HSQL and Derby databases for embedded database. For example h2 database datasource-url like below :
jdbc:h2:~/Desktop/Database/test;DB_CLOSE_ON_EXIT=FALSE;
And in spring boot you can easily do it ,if you read this document Spring Boot-Embedded Databases

Liferay multiple portlets running with same embedded neo4j db

Using spring data neo4j in liferay portlets, Neo4j is locking itself when a portlet is using it, encounter exception like below
Unable to lock store [db.name], this is usually a result of some other Neo4j kernel running using the same store
Is there any way to run multiple portlets with same embedded neo4j db. Can i use Neo4j HA? Looks like Neo4j HA to going to deal with multi-servers, but i only one server. Any ideas?
Thanks in advance!
Did you try including neo4j library files at portal level instead of using at portlet level ?
i.e. to place required .jar files in /lib/ext instead of inside WEB-INF of every portlet.
I'm not an expert in neo4j, but having good experience with liferay. Suggesting above solution from liferay point to ensure common place for all portlets.

Reading from xml file and populating H2 DB table through Apache ServiceMix 4.2.2

I am trying to integrate a simple Enterprise App to a data source(xml file for now) using Apache Service Mix(ASM) ESB. Basically I need to have the ESB pick up content from the xml file and populate corresponding tables in a H2 database(which my app is linked to). I am not sure as to which features of ASM I should be using for the same. If someone could give me a high level idea as to how I should be going about the same I would be very grateful. I have looked at documentation from Fuse ESB and also the ASM documentation but at this point I am totally confused.
Thanks in advance.
Since ServiceMix uses Camel for such work, my first suggestion is to take a look at Apache Camel for it.
For you're example a simple route would look like this:
from("file:location_of_file").unmarshal(registered-jaxB-structure)
.split(simple("probably_your_entities")).to("jdbc:dataSource?sql_insert");
You read your incoming file from the *location_of_file* unmarshall it since it's a XML file to your object-structure with jaxb. After that you probably need to iterate over the entities inside your xml file which is best be done with a split. Now your structure is most likely in a way you can use either for storing with jpa, sql or jdbc.

Resources