Search code examples
snappydata

Maven artifacts for only a SnappyData client?


Today, I am loading a pom with these dependencies. However, the SpringBoot jar created from this is huge and I think it is because it literally contains all the Snappy Store jars, etc.

The SpringBoot Jar that is built bundles all the Jetty jars because Snappy uses an embedded web app (Pulse). I don't want all that, especially since now SpringBoot starts with Jetty and I want EmbeddedTomcat instead.

Is there a specific set of client-only maven dependencies I can include instead?

<dependency>
        <groupId>io.snappydata</groupId>
        <artifactId>snappy-core_2.10</artifactId>
        <version>0.5</version>
    </dependency>
    <dependency>
        <groupId>io.snappydata</groupId>
        <artifactId>snappy-cluster_2.10</artifactId>
        <version>0.5</version>
        <exclusions>
            <exclusion>
                <artifactId>jdk.tools</artifactId>
                <groupId>jdk.tools</groupId>
            </exclusion>
            <exclusion>
                <artifactId>logback-classic</artifactId>
                <groupId>ch.qos.logback</groupId>
            </exclusion>
        </exclusions>
    </dependency>

Solution

  • You can use the snappydata-store-client artifacts to just pull the client jar:

    <dependency>
      <groupId>io.snappydata</groupId>
      <artifactId>snappydata-store-client</artifactId>
      <version>1.5.0</version>
    </dependency>
    

    If using any of Spark's complex types (ArrayType, MapType, StructType) then client will not be able to deserialize the results with just the client jar. For that case you can use "complexTypeAsClob" query hint to get string form of the values (CLOB):

    SELECT * FROM table1 /*+ complexTypeAsClob(1) */