zoukankan      html  css  js  c++  java
  • dremio 开发测试简单说明

    目前官方关于如何进行相关开发测试的明确的文档说明,但是我们基于官方提供的测试用例可以基本了解

    官方提供的测试用例

    sabot/kernel/src/test/java/com/dremio 目录

    ├── ArrowDsUtil.java
    ├── BaseDecimalFunctionTests.java
    ├── BaseTestQuery.java
    ├── DecimalCompleteTest.java
    ├── DremioTestWrapper.java
    ├── ParquetSchemaMerge.java
    ├── PlanTestBase.java
    ├── QueryTestUtil.java
    ├── SingleRowListener.java
    ├── TestAggNullable.java
    ├── TestAggregationQueries.java
    ├── TestAltSortQueries.java
    ├── TestBugFixes.java
    ├── TestBuilder.java
    ├── TestCTASPartitionFilter.java
    ├── TestCaseSensitivity.java
    ├── TestCorrelation.java
    ├── TestDecimalFunctionsInGandivaCodeGen.java
    ├── TestDecimalFunctionsInGandivaOnlyCodeGen.java
    ├── TestDecimalFunctionsInJavaCodeGen.java
    ├── TestDecimalQueries.java
    ├── TestDecimalSetting.java
    ├── TestDecimalStreamAgg.java
    ├── TestDecimalVJoin.java
    ├── TestDecimalVectorizedAgg.java
    ├── TestDisabledFunctionality.java
    ├── TestDropTable.java
    ├── TestExampleQueries.java
    ├── TestExplainJson.java
    ├── TestFilterPastJoin.java
    ├── TestFrameworkTest.java
    ├── TestFunctionsQuery.java
    ├── TestFunctionsWithTypeExpoQueries.java
    ├── TestGandivaOnlyQueries.java
    ├── TestImplicitCasting.java
    ├── TestInList.java
    ├── TestIndexBasedPruning.java
    ├── TestIsNotDistinctFromJoin.java
    ├── TestJoinNullable.java
    ├── TestMergeFilterPlan.java
    ├── TestMergingReceiverSpooling.java
    ├── TestMfsBlockLoader.java
    ├── TestMixedDecimalFunctionTests.java
    ├── TestNljPushdown.java
    ├── TestNotInQueries.java
    ├── TestOutOfMemoryException.java
    ├── TestOutOfMemoryOutcome.java
    ├── TestProjectPushDown.java
    ├── TestResult.java
    ├── TestSchemaChange.java
    ├── TestSelectWithOption.java
    ├── TestStarQueries.java
    ├── TestTextJoin.java
    ├── TestTextWriter.java
    ├── TestTpchDistributed.java
    ├── TestTpchDistributedConcurrent.java
    ├── TestTpchDistributedStreaming.java
    ├── TestTpchExplain.java
    ├── TestTpchLimit0.java
    ├── TestTpchPlanning.java
    ├── TestTpchSingleMode.java
    ├── TestTransitiveJoin.java
    ├── TestTruncateTable.java
    ├── TestUnionAll.java
    ├── TestUnionDistinct.java
    ├── TestVectorizedPartitionSender.java
    ├── common
    ├── exec
    └── sabot

    plugin 测试简单说明

    参考自官方的测试demo
    需要做的事情,初始化一个dremio catalog 服务(进行插件管理),注册自己开发的插件,进行查询测试(注意测试基类需要继承自BaseTestQuery我们可以利用好多base 的方法,test...)

    • 简单参考
     
    public class TestSubPathFileSystemPlugin extends BaseTestQuery {
      @ClassRule
      public static TemporaryFolder testFolder = new TemporaryFolder();
     
      protected static File storageBase;
     
      @Rule
      public TemporarySystemProperties properties = new TemporarySystemProperties();
     
      @Before
      public void before() {
        properties.set(DremioConfig.LEGACY_STORE_VIEWS_ENABLED, "true");
      }
     
      @BeforeClass
      public static void setup() throws Exception {
        testNoResult("alter system set "%s" = 1", FileDatasetHandle.DFS_MAX_FILES.getOptionName());
        generateTestData();
        addSubPathDfsPlugin();
      }
     
      @Test
      public void queryValidPath() throws Exception {
        test("SELECT * FROM subPathDfs."tblInside.csv"");
        test("SELECT * FROM subPathDfs."dirInside/tbl.csv"");
      }

    maven 依赖包

    • 参考
      注意需要引用dremio kernel 的test 包,同时repo 需要使用dremio 自己的
     
    <dependency>
      <groupId>com.dremio.sabot</groupId>
      <artifactId>dremio-sabot-kernel</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
      <exclusions>
            <exclusion>
              <groupId>org.slf4j</groupId>
              <artifactId>slf4j-log4j12</artifactId>
            </exclusion>      
      </exclusions>
    </dependency>
     
    <repositories>
        <repository>
            <id>tencent-public</id>
            <url>http://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>
        </repository>
        <repository>
            <id>dremio-public</id>
            <url>http://maven.dremio.com/public/</url>
        </repository>
        <repository>
            <id>dremio-free</id>
            <url>http://maven.dremio.com/free/</url>
        </repository>
    </repositories>

    说明

    以上是一个简单的说明,实际还需要自己多研究,官方已经提供了好多demo

    参考资料

    https://github.com/dremio/dremio-oss

  • 相关阅读:
    YourSQLDba低版本的一个Bug的浅析
    VMware虚拟机(Linux)如何找出系统中磁盘设备对应的硬盘
    SSH登录报pam_unix(sshd:auth): authentication failure的案例
    Linux shell中如何给文本加上行号呢
    Linux查看系统块大小
    存储基础知识:扇区与块/簇
    SQL Server中GETDATE转换时间时注意事项
    SQL Server 2008 R2执行存储过程sp_MailItemResultSets引起大量PREEMPTIVE_OS_WAITFORSINGLEOBJEC等待
    Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool
    SQL Server 2014下Database Mail Engine进程消耗大量CPU资源
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/14642625.html
Copyright © 2011-2022 走看看